AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
320 stars 137 forks source link

when data is empty it still open empty pop up , how to close this popup when its data is empty..? #76

Closed ardhendu12345 closed 2 years ago

AdelRedaa97 commented 2 years ago

Try disabled={data.length == 0} the dropdown won't be opened.

ardhendu12345 commented 2 years ago

@AdelRedaa97 but i have to shown an alert on touch it , if it get disabled then idt should not get touch it ,... actually i have to show an alert when data is empty, but now onFocus i use alert but along with the alert it open its popup with the empty popup with loader ...i just want to show the alert statement but not the empty popup... please help

AdelRedaa97 commented 2 years ago

The thing that is missing in your solution is to close the dropdown after the user pressed ok in the alert right?

ardhendu12345 commented 2 years ago

No, actually i have three dropdown , if you not select from the first then second one and third one are vacant data , when one user not selecting first, tries to select second then i add onFocus alert to select first one then only able to select second ..but when user direct tries to press seconnd one then then as there is no data it shows blank popup..and the alert simultaneously... i only want to alert user not the blank popup its a bad user experience ...how to do that...i show alert using onFocus() callback function..please help

AdelRedaa97 commented 2 years ago

https://snack.expo.dev/@adelredaa97/b978f0

look at this example and tell me if that is what you want or not.

ardhendu12345 commented 2 years ago

yes , it is what i want...Thanks...