forked from abner/for-legacy-web
Fix page height on mobile.
Fix keyboard focus on mobile.
This commit is contained in:
@@ -2,6 +2,7 @@ import { isTouchscreenDevice } from "../lib/isTouchscreenDevice";
|
||||
import { createGlobalStyle } from "styled-components";
|
||||
import { connectState } from "../redux/connector";
|
||||
import { Children } from "../types/Preact";
|
||||
import { useEffect } from "preact/hooks";
|
||||
import { createContext } from "preact";
|
||||
import { Helmet } from "react-helmet";
|
||||
|
||||
@@ -126,6 +127,14 @@ function Theme(props: Props) {
|
||||
...props.options?.custom
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const resize = () => document.documentElement.style.setProperty('--app-height', `${window.innerHeight}px`);
|
||||
resize();
|
||||
|
||||
window.addEventListener('resize', resize);
|
||||
return () => window.removeEventListener('resize', resize);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ThemeContext.Provider value={theme}>
|
||||
<Helmet>
|
||||
|
||||
Reference in New Issue
Block a user