diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d0d1e699..6a68d0161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/client/ui/ios.js b/src/client/ui/ios.js index 18453b2d1..b40c10e0a 100644 --- a/src/client/ui/ios.js +++ b/src/client/ui/ios.js @@ -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