fix: editor content being hidden under keyboard on mobile (#1410)

This commit is contained in:
Aman Harwara
2022-08-25 15:01:44 +05:30
committed by GitHub
parent c336f9de18
commit 520b3add0f
18 changed files with 124 additions and 72 deletions

View File

@@ -9,6 +9,8 @@ import { getPositionedPopoverStyles } from './GetPositionedPopoverStyles'
import { PopoverContentProps } from './Types'
import { getPopoverMaxHeight, getAppRect } from './Utils/Rect'
import { usePopoverCloseOnClickOutside } from './Utils/usePopoverCloseOnClickOutside'
import { fitNodeToMobileScreen } from '@/Utils'
import { useDisableBodyScrollOnMobile } from '@/Hooks/useDisableBodyScrollOnMobile'
const PositionedPopoverContent = ({
align = 'end',
@@ -49,6 +51,8 @@ const PositionedPopoverContent = ({
childPopovers,
})
useDisableBodyScrollOnMobile()
return (
<Portal>
<div
@@ -63,6 +67,7 @@ const PositionedPopoverContent = ({
}}
ref={(node) => {
setPopoverElement(node)
fitNodeToMobileScreen(node)
}}
data-popover={id}
>