react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.49k stars 280 forks source link

Selected value is not shown in Android dropdown mode #422

Closed lukeharvey closed 2 years ago

lukeharvey commented 2 years ago

While attempting to upgrade this package in my app to the latest version, I noticed that the selectedValue no longer appears in the Android picker in dropdown mode. By a process of elimination, it seems that the issue was introduced in v1.10.0 and probably as a result of https://github.com/react-native-picker/picker/issues/195

In v1.9.18, the selected value correctly appears

Screenshot 2022-06-10 at 4 03 58 pm

However, in v1.10.0+, the selected value no longer appears

Screenshot 2022-06-10 at 3 58 16 pm
lukeharvey commented 2 years ago

Turns out the issue was not reproducible in a clean React Native build, which made me think it must be a local Android config setting. In our android/app/src/main/values/styles.xml file we had the following line <item name="android:spinnerStyle">@style/Widget.AppCompat.Spinner.Underlined</item> (possibly left over from an old React Native version), and removing that line appears to fix the issue