hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
969 stars 294 forks source link

Tap outside to close Dropdown #721

Open maniish opened 8 months ago

maniish commented 8 months ago

I have tried to use TouchableWithoutFeedback for closing Dropdown when clicked outside. I have wrapped it outside View (page). But when I click on dropdown or select item, it delays the output (like selection/open).

Am I doing anything wrong? How can we achieve this like other dropdown components.

Hoshiiii2602 commented 6 months ago

Your idea is correct, but if you cover the whole screen, you can press it to catch it and turn it off. You can use TouchableOpacity with actionOpacity={1} and Pressable.