I am using the react-native-dropdown-select-list
. When dropdown is used/opened the items below on screen are pushed down instead of the menu coming up above them and not moving the items down. How to stop this from happening?
increased and decreased the zIndex
. It didn't work
You can do this by using the dropdownStyles
prop to style the dropdown. Adding position: absolute
makes sure the dropdown goes over the other elements and does not push them. Some additional styling to make it look as before and overlap the other components.
<SelectList
dropdownStyles={{
backgroundColor: "white",
position: "absolute",
top: 40,
width: "100%",
zIndex: 999,
}}
/>