lawnstarter / react-native-picker-select

🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
https://npmjs.com/package/react-native-picker-select
MIT License
1.74k stars 497 forks source link

Can't use custom icon with latest @react-native-picker/picker #471

Open fnando opened 2 years ago

fnando commented 2 years ago

Describe the bug

Upgrading to @react-native-picker/picker's latest version prevents from using a custom icon in Android, because it never hides the original icon.

To Reproduce
Steps to reproduce the behavior:

  1. Use something like yarn add @react-native-picker/picker@^2.2.1
  2. Run react-native run-android in an app that has the dropdown with a custom icon

Expected behavior

Render just the custom icon, just like it does when using an older @react-native-picker/picker version (e.g. 1.9.11).

Screenshots

CleanShot 2021-12-01 at 11 35 05@2x

Additional details

Reproduction and/or code sample

Couldn't figure out a way of creating a snack with @react-native-picker/picker@^2.2.1.

vetalmon commented 2 years ago

Same issue. Any ideas?

andreicioc133 commented 2 years ago

I solved this by adding useNativeAndroidPickerStyle prop and setting it to false. Then i styled with inputAndroid and worked fine.Hope it helps.

StasNemy commented 1 day ago

Actually you can hide Picker using style and wrap the Picker by Pressable or any other component.