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 28, 2022
1 parent bbf9a9a commit 76364bf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/src/plugins/Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ export default {
return
}

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

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 76364bf

Please sign in to comment.