fix: responsiveness when resizing window on web/desktop (#1637)

This commit is contained in:
Aman Harwara
2022-09-24 21:24:10 +05:30
committed by GitHub
parent c2a1918843
commit e4b1b64119
8 changed files with 46 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
import { Platform, platformFromString } from '@standardnotes/snjs'
import { IsDesktopPlatform, IsWebPlatform } from '@/Constants/Version'
import { EMAIL_REGEX } from '../Constants/Constants'
import { MediaQueryBreakpoints } from '@/Hooks/useMediaQuery'
declare const process: {
env: {
@@ -202,13 +203,4 @@ export const disableIosTextFieldZoom = () => {
}
}
export const isMobileScreen = () => !window.matchMedia('(min-width: 768px)').matches
export const fitNodeToMobileScreen = (node: HTMLElement | null) => {
if (!node || !isMobileScreen()) {
return
}
node.style.height = `${visualViewport.height}px`
node.style.position = 'absolute'
node.style.top = `${document.documentElement.scrollTop}px`
}
export const isMobileScreen = () => !window.matchMedia(MediaQueryBreakpoints.md).matches