refactor: make modals/popovers scrollable on ios when keyboard is open

This commit is contained in:
Aman Harwara
2023-01-27 20:50:40 +05:30
parent 821b0a9c14
commit 3fe57b415e
4 changed files with 10 additions and 3 deletions

View File

@@ -592,7 +592,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 48289402952f4f7a4e235de70a9a590aa0b79ef4
@@ -613,7 +613,7 @@ SPEC CHECKSUMS:
MMKV: 9c4663aa7ca255d478ff10f2f5cb7d17c1651ccd
MMKVCore: 89f5c8a66bba2dcd551779dea4d412eeec8ff5bb
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: e1866f61af7049eb3d8e08e8b133abd38bc1ca7a
RCTTypeSafety: 27c2ac1b00609a432ced1ae701247593f07f901e
React: bb3e06418d2cc48a84f9666a576c7b38e89cd7db

View File

@@ -31,7 +31,7 @@ const MenuItem = forwardRef(
role="menuitem"
tabIndex={typeof tabIndex === 'number' ? tabIndex : FOCUSABLE_BUT_NOT_TABBABLE}
className={classNames(
'flex w-full cursor-pointer border-0 bg-transparent px-3 py-2 text-left md:py-1.5',
'flex w-full cursor-pointer select-none border-0 bg-transparent px-3 py-2 text-left md:py-1.5',
'text-mobile-menu-item text-text hover:bg-contrast hover:text-foreground',
'focus:bg-info-backdrop focus:shadow-none md:text-tablet-menu-item lg:text-menu-item',
className,

View File

@@ -9,6 +9,7 @@ export const setCustomViewportHeight = (height: number, suffix: 'px' | 'vh', for
log(LoggingDomain.Viewport, `setCustomViewportHeight: ${value}`)
document.body.style.height = value
document.documentElement.style.setProperty('--ios-viewport-height', value)
if (forceTriggerResizeEvent) {
window.dispatchEvent(new Event('resize'))

View File

@@ -142,3 +142,9 @@
top: 0;
}
}
[data-reach-dialog-overlay],
[data-mobile-popover] {
max-height: none;
max-height: var(--ios-viewport-height, none);
}