The next View component after the dropdown-picker is used is visible. If we exclude the <View> and just use the <Text> component. The <Text> component is hidden. However, if we use <Text> inside <View> the component is not hidden.
I tried using zIndex but didn't work. Maybe because I didn't use it in the right place. I also tried using different background color but that too didn't work.
Here is the expo link too. https://snack.expo.dev/5-GpW2eEU8
If I add zIndex to that code, it works fine on snack and even the uploaded code from there work well in my device. However, the same code in my local machine does not work. Is it because of the react native version?
My package.json file is:
"name": "Test",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "^47.0.0",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
"react-native": "0.70.5",
"react-native-dropdown-picker": "^5.4.4"
},
"devDependencies": {
"@babel/core": "^7.19.3"
},
"private": true
}
Interestingly, it works fine with dropDownDirection='TOP'
Also, when I tried using Element Inspector, the <View>
after dropdown gets hidden.