wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.53k stars 712 forks source link

Picker component doesn't select first item when you don't scroll #2420

Closed madmeatballs closed 1 year ago

madmeatballs commented 1 year ago

Description

Picker is not selecting first item when you don't scroll through the list using "useNativePicker"

Related to

Steps to reproduce

Steps to reproduce the behavior:

  1. Use your picker component with useNativePicker
  2. Click on 'Done"
  3. See that no value is selected

Expected behavior

It should select the first item regardless if you scroll the list, it will be unnecessary for the user to scroll to select the first item.

Actual behavior

Not selecting first item when tapping done when you don't scroll

More Info

Code snippet

    <Picker
      mode="SINGLE"
      onChange={onChange}
      placeholder={placeholder}
      value={value}
      useNativePicker
    >
      {dropdownList.map(item => (
          <Picker.Item key={item.value} value={item.value} label={item.label} />
      ))}
    </Picker>

Environment

Affected platforms

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.