-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
MenuquestionQuestion related to the library, not an issueQuestion related to the library, not an issue
Description
Ask your Question
I have a few dropdowns that have a variable number of Menu Item's and I've noticed that they sometimes will run outside the bounds of the bottom of the screen. I've tried setting a maxHeight in the contentStyle prop but that seems to allow the menu items to overflow their container.
My current implementation:
<Menu
visible={showDropdown}
onDismiss={() => setShowDropdown(false)}
style={{ paddingTop: 50 }}
anchor={
<Button
mode={mode}
disabled={disabled}
icon={icon}
onPress={() => setShowDropdown(true)}
contentStyle={{ flexDirection: 'row-reverse' }}
labelStyle={labelStyle}
>
{value || placeholder}
</Button>
}
>
{
list.map(({ label, value }, i) => (
<View key={i}>
<Menu.Item
title={label}
onPress={() => {
onSelect(value)
setShowDropdown(false)
}}
/>
</View>
))
}
</Menu>
Metadata
Metadata
Assignees
Labels
MenuquestionQuestion related to the library, not an issueQuestion related to the library, not an issue