Skip to content

Commit 02d6571

Browse files
luacmartinsOSBotify
authored andcommitted
Merge pull request #49233 from Expensify/cmartins-fixSavedIssues
Fix overlapping scrollview (cherry picked from commit 7d60884) (CP triggered by luacmartins)
1 parent b549307 commit 02d6571

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/PopoverMenu.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
99
import useResponsiveLayout from '@hooks/useResponsiveLayout';
1010
import useTheme from '@hooks/useTheme';
1111
import useThemeStyles from '@hooks/useThemeStyles';
12+
import useWindowDimensions from '@hooks/useWindowDimensions';
1213
import * as Browser from '@libs/Browser';
1314
import * as Modal from '@userActions/Modal';
1415
import CONST from '@src/CONST';
@@ -135,6 +136,7 @@ function PopoverMenu({
135136
const [currentMenuItems, setCurrentMenuItems] = useState(menuItems);
136137
const currentMenuItemsFocusedIndex = currentMenuItems?.findIndex((option) => option.isSelected);
137138
const [enteredSubMenuIndexes, setEnteredSubMenuIndexes] = useState<readonly number[]>(CONST.EMPTY_ARRAY);
139+
const {windowHeight} = useWindowDimensions();
138140

139141
const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({initialFocusedIndex: currentMenuItemsFocusedIndex, maxIndex: currentMenuItems.length - 1, isActive: isVisible});
140142

@@ -256,7 +258,7 @@ function PopoverMenu({
256258
restoreFocusType={restoreFocusType}
257259
>
258260
<FocusTrapForModal active={isVisible}>
259-
<ScrollView style={isSmallScreenWidth ? {} : styles.createMenuContainer}>
261+
<ScrollView style={isSmallScreenWidth ? {maxHeight: windowHeight - 250} : styles.createMenuContainer}>
260262
{renderHeaderText()}
261263
{enteredSubMenuIndexes.length > 0 && renderBackButtonItem()}
262264
{currentMenuItems.map((item, menuIndex) => (

0 commit comments

Comments
 (0)