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

No way to detect when user has stopped scrolling in iOS #399

Open Jorundur opened 2 years ago

Jorundur commented 2 years ago

I have a use case where I want to hide the Picker after the user makes a selection. This is for iOS and I'm using Picker, not PickerIOS.

I can hide the Picker in the onValueChange but I feel like that's too "quick" for a nice user experience, i.e. the user might be scrolling in the Picker in iOS, stop on some value for a second and then continue scrolling. The onValueChange func gets called as soon as I stop on some value so the Picker would disappear right then and there even though the user actually meant to continue scrolling through the list.

So ideally I'd like to be able to hide the Picker 1 second after a selection or thereabouts provided that the user didn't start scrolling again.

How can I detect that the user is still touching/scrolling in the Picker or has stopped touching/scrolling it?

I've tried playing around with all the touch events that were available to me and also attempted wrapping the component in another View and playing around with onResponderX events without luck.

Faseeh-Abbas-Khan commented 2 years ago

same issue here with me as well, I cant detect if the user stopped on the desired value or just stopped and will start scrolling again