fix: Fixed issue where some menus would get hidden behind the keyboard on iOS
This commit is contained in:
@@ -35,6 +35,7 @@ const LinkedItemsButton = ({ linkingController, onClickPreprocessing }: Props) =
|
|||||||
anchorElement={buttonRef}
|
anchorElement={buttonRef}
|
||||||
open={isLinkingPanelOpen}
|
open={isLinkingPanelOpen}
|
||||||
className="pb-2"
|
className="pb-2"
|
||||||
|
forceFullHeightOnMobile
|
||||||
>
|
>
|
||||||
<LinkedItemsPanel item={activeItem} />
|
<LinkedItemsPanel item={activeItem} />
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ const MobilePopoverContent = ({
|
|||||||
title,
|
title,
|
||||||
className,
|
className,
|
||||||
id,
|
id,
|
||||||
|
forceFullHeightOnMobile,
|
||||||
}: {
|
}: {
|
||||||
open: boolean
|
open: boolean
|
||||||
requestClose: () => void
|
requestClose: () => void
|
||||||
@@ -31,6 +32,7 @@ const MobilePopoverContent = ({
|
|||||||
title: string
|
title: string
|
||||||
id: string
|
id: string
|
||||||
className?: string
|
className?: string
|
||||||
|
forceFullHeightOnMobile?: boolean
|
||||||
}) => {
|
}) => {
|
||||||
const isMobileScreen = useMediaQuery(MutuallyExclusiveMediaQueryBreakpoints.sm)
|
const isMobileScreen = useMediaQuery(MutuallyExclusiveMediaQueryBreakpoints.sm)
|
||||||
const [isMounted, setPopoverElement, element] = useModalAnimation(open, isMobileScreen)
|
const [isMounted, setPopoverElement, element] = useModalAnimation(open, isMobileScreen)
|
||||||
@@ -164,11 +166,14 @@ const MobilePopoverContent = ({
|
|||||||
return (
|
return (
|
||||||
<Portal>
|
<Portal>
|
||||||
<DisableScroll />
|
<DisableScroll />
|
||||||
<div className="fixed inset-0 z-modal">
|
<div className="fixed left-0 top-0 z-modal h-full max-h-[var(--ios-viewport-height,_none)] w-full">
|
||||||
<div className="absolute inset-0 z-0 bg-passive-4 opacity-0" ref={setUnderlayElement} />
|
<div className="absolute z-0 h-full w-full bg-passive-4 opacity-0" ref={setUnderlayElement} />
|
||||||
<div
|
<div
|
||||||
ref={mergeRefs([setPopoverElement, addCloseMethod])}
|
ref={mergeRefs([setPopoverElement, addCloseMethod])}
|
||||||
className="z-1 absolute bottom-0 flex max-h-[calc(100%_-_max(var(--safe-area-inset-top),2rem))] min-h-[40%] w-full flex-col rounded-t-xl bg-default pb-safe-bottom"
|
className={classNames(
|
||||||
|
'z-1 absolute bottom-0 flex max-h-[calc(100%_-_max(var(--safe-area-inset-top),2rem))] min-h-[40%] w-full flex-col rounded-t-xl bg-default pb-safe-bottom',
|
||||||
|
forceFullHeightOnMobile && 'h-full',
|
||||||
|
)}
|
||||||
id={'popover/' + id}
|
id={'popover/' + id}
|
||||||
data-popover={id}
|
data-popover={id}
|
||||||
data-mobile-popover
|
data-mobile-popover
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ const Popover = (props: PopoverProps) => {
|
|||||||
title={props.title}
|
title={props.title}
|
||||||
className={props.className}
|
className={props.className}
|
||||||
id={popoverId}
|
id={popoverId}
|
||||||
|
forceFullHeightOnMobile={props.forceFullHeightOnMobile}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</MobilePopoverContent>
|
</MobilePopoverContent>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ type CommonPopoverProps = {
|
|||||||
togglePopover?: () => void
|
togglePopover?: () => void
|
||||||
disableMobileFullscreenTakeover?: boolean
|
disableMobileFullscreenTakeover?: boolean
|
||||||
disableFlip?: boolean
|
disableFlip?: boolean
|
||||||
|
forceFullHeightOnMobile?: boolean
|
||||||
title: string
|
title: string
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
offset?: number
|
offset?: number
|
||||||
|
|||||||
Reference in New Issue
Block a user