mirror of
https://github.com/codex-team/editor.js
synced 2024-05-10 02:16:46 +02:00
Scroll fix
This commit is contained in:
parent
085da8e09a
commit
82deae543e
|
@ -269,6 +269,14 @@ export default class UI extends Module<UINodes> {
|
|||
this.isMobile = window.innerWidth < 650;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates --vh variable value, which allows to calculate actual 100vh value for mobile browsers
|
||||
*/
|
||||
private setAppHeightFraction(): void {
|
||||
const doc = document.documentElement
|
||||
doc.style.setProperty('--vh', (window.innerHeight * 0.01) + 'px');
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes Editor.js interface
|
||||
*/
|
||||
|
@ -437,6 +445,11 @@ export default class UI extends Module<UINodes> {
|
|||
* Detect mobile version
|
||||
*/
|
||||
this.checkIsMobile();
|
||||
|
||||
/**
|
||||
* Updates stored window height fraction
|
||||
*/
|
||||
this.setAppHeightFraction();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -129,7 +129,8 @@
|
|||
}
|
||||
|
||||
.ce-scroll-locked, .ce-scroll-locked > body {
|
||||
height: 100vh;
|
||||
height: 100vh; /* Fallback for browsers that do not support Custom Properties */
|
||||
height: calc(var(--vh) * 100);
|
||||
overflow: hidden;
|
||||
/**
|
||||
* Mobile Safari fix
|
||||
|
|
Loading…
Reference in a new issue