fix: editor content being hidden under keyboard on mobile (#1410)
This commit is contained in:
@@ -2,8 +2,6 @@ import { Platform, platformFromString } from '@standardnotes/snjs'
|
||||
import { IsDesktopPlatform, IsWebPlatform } from '@/Constants/Version'
|
||||
import { EMAIL_REGEX } from '../Constants/Constants'
|
||||
|
||||
export { isMobile } from './IsMobile'
|
||||
|
||||
declare const process: {
|
||||
env: {
|
||||
NODE_ENV: string | null | undefined
|
||||
@@ -203,3 +201,14 @@ export const disableIosTextFieldZoom = () => {
|
||||
addMaximumScaleToMetaViewport()
|
||||
}
|
||||
}
|
||||
|
||||
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`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user