react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.53k stars 289 forks source link

[Android] Hold and scroll down on the picker opens up the picker #581

Open hardrese7 opened 2 months ago

hardrese7 commented 2 months ago

Describe the bug

On Android, when you press, hold, and scroll on the picker input without releasing, the picker opens immediately below the input.

Steps to reproduce the behavior: use snack: https://snack.expo.dev/@hardrese7/react-native-picker-issue

  1. Press and hold the picker.
  2. Scroll Down.
  3. Notice that the picker appears directly below the input.

Expected behavior: The picker should not open when holding and scrolling.

Actual behavior: The picker appears directly below the input when holding and scrolling.

Demo: Screen Recording 2024-08-29 at 12 18 23

Why is it important? It used to work this way for ages, and we could live with that; but something recently broke, and and now changing the picker in this manner doesn't trigger the onValueChange event. It seems, it was broken in 2.5.0.

I suggest fixing this issue and adding a flag to disable this behavior, as it can lead to unintentional value changes by users during scrolling.