Skip to content

Scrolling above the first option causes the picker to have blank label and value "null" #657

Open
@oljubuncic1

Description

@oljubuncic1

Describe the bug

On IOS, when the picker is scrolled to the beginning, you are able to scroll "above" the first option which sets the value to "null" as a string and shows empty label.

To Reproduce

Steps to reproduce the behavior:

  1. Run the app
  2. Click on RNPickerSelect Component
  3. Scroll to the top and scroll as far above as you can
  4. The value gets set to "null" and the label is blank

Expected behavior

First option should be selected.

Screenshots

n/a

Additional details

  • Device: iPhone13
  • OS: iOS 18
  • react-native-picker-select version: 9.3.1 - it started happening from 9.0.0, on version 8 it works fine
  • react-native version: 0.76.6
  • expo sdk version: 52.0.27

Reproduction and/or code sample

<RNPickerSelect
        items={items}
        onValueChange={field.onChange}
        value={field.value}
        placeholder={required ? {} : { label: 'All', value: null }}
        useNativeAndroidPickerStyle={false}
        doneText="Choose"
        style={{ inputIOSContainer: { pointerEvents: 'none' } }}
      >

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions