react-native-picker-select icon indicating copy to clipboard operation
react-native-picker-select copied to clipboard

Add a way to clear the picker

Open DaanKorver opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.
I have a form that needs to be cleared if its valid and ready to send. The only problem is that I can't seem to clear the picker/reset the state of the picker

Describe the solution you'd like
I want a option to programmatically clear the input

Describe alternatives you've considered
I tried to use some other packages but this ones looks the best.

Additional details
N.A.

DaanKorver avatar Feb 04 '22 13:02 DaanKorver

+1

Hassan426 avatar Mar 23 '22 12:03 Hassan426

If you are tracking the value in a variable, you can just set that variable to null or undefined to clear the input.

EmilyRagan avatar Mar 23 '22 18:03 EmilyRagan

That won't clear the input, because the value prop

Will attempt to locate a matching item from the items array by checking each item's value property. If found, it will update the component to show that item as selected. If the value is not found, it will default to the first item.

CptFabulouso avatar Jul 29 '22 07:07 CptFabulouso

Closing this issue since the package isn't being updated anymore.

DaanKorver avatar Sep 04 '22 12:09 DaanKorver