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.73k stars 490 forks source link

togglePicker() function close then reopen modal #579

Closed saaspeter closed 1 month ago

saaspeter commented 1 month ago

Describe the bug
I want to close the modal dialog when press on "arrow down" icon, I use tooglePicker, when press the arrow down, the dialog firstly close then reopen the dialog. The demo code also has same issue: https://snack.expo.dev/@lfkwtz/react-native-picker-select , press: the dropdown in the line of "useNativeAndroidPickerStyle".

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://snack.expo.dev/@lfkwtz/react-native-picker-select
  2. Click on dropdown with title of "useNativeAndroidPickerStyle"
  3. in the dialog, click the down arrow icon in the left corner, you can see the dialog firstly close then reopen it again.

the Evn is IOS, the android env has some problem to launch.

Expected behavior
close the dialog, not reopen it.

Screenshots
see: https://snack.expo.dev/@lfkwtz/react-native-picker-select

Additional details

Reproduction and/or code sample
https://snack.expo.dev/@lfkwtz/react-native-picker-select onDownArrow={() => { this.inputRefs.favSport1.togglePicker(); }}

saaspeter commented 1 month ago

after I saw the source code, I found there is no need to call togglePicker() function again in onDownArrow, because the source code already call togglePicker(). So I think need update the code in https://snack.expo.dev/@lfkwtz/react-native-picker-select close this bug, hope to update the snack code.