fix: fixed issue where popover menus would open with incorrect positioning on desktop

This commit is contained in:
Mo
2022-12-05 17:34:41 -06:00
parent ccde207de8
commit a66bb08c3b
2 changed files with 14 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
import { DeviceInterface, MobileDeviceInterface, Platform, platformFromString } from '@standardnotes/snjs'
import { IsDesktopPlatform, IsWebPlatform } from '@/Constants/Version'
import { EMAIL_REGEX } from '../Constants/Constants'
import { MediaQueryBreakpoints } from '@/Hooks/useMediaQuery'
import { MutuallyExclusiveMediaQueryBreakpoints } from '@/Hooks/useMediaQuery'
declare const process: {
env: {
@@ -206,12 +206,9 @@ export const disableIosTextFieldZoom = () => {
}
}
export const isMobileScreen = () => window.matchMedia(MediaQueryBreakpoints.sm).matches
export const isMobileScreen = () => window.matchMedia(MutuallyExclusiveMediaQueryBreakpoints.sm).matches
export const isTabletScreen = () =>
!isMobileScreen() &&
window.matchMedia(MediaQueryBreakpoints.md).matches &&
!window.matchMedia(MediaQueryBreakpoints.lg).matches
export const isTabletScreen = () => window.matchMedia(MutuallyExclusiveMediaQueryBreakpoints.md).matches
export const isTabletOrMobileScreen = () => isMobileScreen() || isTabletScreen()