Skip to content

Commit

Permalink
fix(Screen): use viewport to get window size to avoid problems with z…
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Jan 29, 2022
1 parent 59b1991 commit fcf0f8f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ui/src/plugins/Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ export default {
return
}

const { visualViewport } = window
const getSize = visualViewport === void 0
? () => [ window.innerWidth, window.innerHeight ]
: () => [
visualViewport.width * visualViewport.scale + window.innerWidth - document.scrollingElement.clientWidth,
visualViewport.height * visualViewport.scale + window.innerHeight - document.scrollingElement.clientHeight
]

const classes = cfg.screen !== void 0 && cfg.screen.bodyClasses === true

const update = force => {
const
w = window.innerWidth,
h = window.innerHeight
const [ w, h ] = getSize()

if (h !== this.height) {
this.height = h
Expand Down

0 comments on commit fcf0f8f

Please sign in to comment.