diff --git a/packages/web/src/javascripts/App.tsx b/packages/web/src/javascripts/App.tsx index 70bf42a37..d4772b43b 100644 --- a/packages/web/src/javascripts/App.tsx +++ b/packages/web/src/javascripts/App.tsx @@ -41,6 +41,13 @@ const getKey = () => { return keyCount++ } +const setViewportHeight = () => { + document.documentElement.style.setProperty( + '--viewport-height', + `${visualViewport ? visualViewport.height : window.innerHeight}px`, + ) +} + const startApplication: StartApplication = async function startApplication( defaultSyncServerHost: string, device: WebOrDesktopDevice, @@ -53,6 +60,7 @@ const startApplication: StartApplication = async function startApplication( let root: Root const onDestroy = () => { + window.removeEventListener('orientationchange', setViewportHeight) const rootElement = document.getElementById(ElementIds.RootId) as HTMLElement root.unmount() rootElement.remove() @@ -66,10 +74,8 @@ const startApplication: StartApplication = async function startApplication( root = createRoot(appendedRootNode) disableIosTextFieldZoom() - document.documentElement.style.setProperty( - '--viewport-height', - `${visualViewport ? visualViewport.height : window.innerHeight}px`, - ) + setViewportHeight() + window.addEventListener('orientationchange', setViewportHeight) root.render( = ({
= ({ selectionController, searchOptionsController, }) => { - const { toggleAppPane } = useResponsiveAppPane() + const { isNotesListVisibleOnTablets, toggleAppPane } = useResponsiveAppPane() const fileInputRef = useRef(null) const itemsViewPanelRef = useRef(null) @@ -181,12 +182,19 @@ const ContentListView: FunctionComponent = ({ [isFilesSmartView], ) + const matchesMediumBreakpoint = useMediaQuery(MediaQueryBreakpoints.md) + const matchesXLBreakpoint = useMediaQuery(MediaQueryBreakpoints.xl) + const isTabletScreenSize = matchesMediumBreakpoint && !matchesXLBreakpoint + return (
= ({ application }) => { const viewControllerManager = useMemo(() => application.getViewControllerManager(), [application]) const ref = useRef(null) const [panelWidth, setPanelWidth] = useState(0) - const { toggleAppPane } = useResponsiveAppPane() + const { selectedPane, toggleAppPane } = useResponsiveAppPane() const [hasPasscode, setHasPasscode] = useState(() => application.hasPasscode()) useEffect(() => { @@ -63,7 +63,11 @@ const Navigation: FunctionComponent = ({ application }) => {