react-native-picker / picker

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

togglePicker() not working on android #323

Closed tiennguyen9988 closed 3 years ago

tiennguyen9988 commented 3 years ago

I need trigger open Picker from button. I used togglePicker and it's nice on ios but not working on android. Please help me any solution ?

anishsundarjee commented 3 years ago

You can toggle using the focus() and blur() methods provided by the picker library and use the useRef hook

ref={refPicker} Add that to your picker

and create a function to toggle using refPicker.current.focus() to focus refPicker.current.blur() to blur

hope this helps

shalomTalker commented 3 years ago

this solution work also i expo with web?