ios: attempt to fix rendering glitch when waking up after sleep
This commit is contained in:
parent
782491282c
commit
7ffe125623
2 changed files with 17 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
- bug fixes
|
||||
- canvas: `onTouch` not triggered on iOS when when `event.force`, `event.altitudeAngle` or `event.azimuthAngle` changes
|
||||
- switch: interaction issue when value labels contain icons
|
||||
- ios: attempt to fix rendering glitch when waking up after sleep
|
||||
|
||||
## 1.18.1
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,22 @@ if (iOS && !iOS13) {
|
|||
|
||||
}
|
||||
|
||||
if (iOS) {
|
||||
// when waking from sleep, iOS may have trouble rendering the session properly
|
||||
// this attempts to force a full redraw by shortly resizing the main container
|
||||
document.onvisibilitychange = ()=>{
|
||||
if (document.visibilityState === 'visible') {
|
||||
var main = DOM.get('osc-panel-container#main')[0]
|
||||
main.style.marginBottom = '1px'
|
||||
main.style.marginRight = '1px'
|
||||
setTimeout(()=>{
|
||||
main.style.marginBottom = ''
|
||||
main.style.marginRight = ''
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (iOS13) document.body.classList.add('iOS13')
|
||||
|
||||
module.exports = iOS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue