instea/react-native-popup-menu

Posible improvement

Closed this issue · 1 comments

I started using this plugin/component and it is really nice. I created a Dropdown component based on this component and I realized that if I used a fixed height with a bunch of options, the options/text get out the popup. I think it is a react native bug but I fixed it by replacing the MenuOptions Container to a ScrollView. I do not know if the popup was not thinking to handle this.
This is the example:
<MenuOptions customStyles={{optionsContainer:{height: 100}}} renderOptionsContainer={(options) => <ScrollView>{options}</Scrollview>} />

With this line you have a popup with a scroll. It is work for android and ios, I already tested it.

thanks for comment. I believe it might have something with overflow. Popup menu by default does not render the scrollview (as we don't know preferred height).
Your example is very similar to our official scrollview example

<MenuOptions>
  <ScrollView style={{ maxHeight: 200 }}>
    <MenuOption value={1} text='One' />
    <MenuOption value={2} text='Two' />
    ...
  </ScrollView>
</MenuOptions>