File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -269,6 +269,14 @@ export default class UI extends Module<UINodes> {
269269 this . isMobile = window . innerWidth < 650 ;
270270 }
271271
272+ /**
273+ * Updates --vh variable value, which allows to calculate actual 100vh value for mobile browsers
274+ */
275+ private setAppHeightFraction ( ) : void {
276+ const doc = document . documentElement
277+ doc . style . setProperty ( '--vh' , ( window . innerHeight * 0.01 ) + 'px' ) ;
278+ }
279+
272280 /**
273281 * Makes Editor.js interface
274282 */
@@ -437,6 +445,11 @@ export default class UI extends Module<UINodes> {
437445 * Detect mobile version
438446 */
439447 this . checkIsMobile ( ) ;
448+
449+ /**
450+ * Updates stored window height fraction
451+ */
452+ this . setAppHeightFraction ( ) ;
440453 }
441454
442455 /**
Original file line number Diff line number Diff line change 129129}
130130
131131.ce-scroll-locked , .ce-scroll-locked > body {
132- height : 100vh ;
132+ height : 100vh ; /* Fallback for browsers that do not support Custom Properties */
133+ height : calc (var (--vh ) * 100 );
133134 overflow : hidden;
134135 /**
135136 * Mobile Safari fix
You can’t perform that action at this time.
0 commit comments