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

Want to add custom button for picker to show options #94

Open soberservicesguy opened 4 years ago

soberservicesguy commented 4 years ago

Question

I want to remove the dropdown button and use my own for styling, can you please let me know the following: 1- How to hide the existing dropdown button (one hack is to put some bg color over it to hide but proper method would be appreciated) 2- What event / callback does that dropdown button fire so that I can use the same event for it

Thanks

Egizas commented 4 years ago

same here

lostchopstik commented 4 years ago

+1 for needing events like show() and hide()

mschipperheyn commented 4 years ago

An issue that I have is that in a tight space, the caret seems to require a lot of horizontal space and hide the label content if it doesn't get it

jackpordi commented 3 years ago

+1 to all the above. I can't believe we still have this issue in 2020. Right now I'm having to do some hacky absolute positioning stuff to overlay my custom button on top of the actual picker....

2xSamurai commented 3 years ago

same here. I have a form with multiple pickers. I created a custom component for iOS without realizing that we need to click on the dropdown for Android to show.

I think this is a very basic feature. At least show and hide should be there.

Thanks for the plugin.

Matiyeu commented 3 years ago

+1

adnanaslam475 commented 3 years ago

how can i add images with picker item?

alwyntan commented 7 months ago

Still a problem in 2024

Now that there are focus() and blur() methods, one workaround is to add style={{ display: 'none' }} to the component if it's android and call focus() to show the items.