react-native-picker / picker

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

Picker doesn't select value unless I scroll #503

Open aziyatali opened 1 year ago

aziyatali commented 1 year ago

Picker version: "@react-native-picker/picker": "^2.4.10", React-Native version: "react-native": "0.70.7",

Brief: when I click it and modal appears, then if user wants to select the first option then it won't pick unless they scroll. Seem onChangeEvent doesn't get triggered for the first option. Any help is appreciated.

Here I demonstrated how it is happening.

https://github.com/react-native-picker/picker/assets/46732700/d9921a76-9043-480b-9197-efdba634072f

Here is the code:

<View style={styles.modalView}>
            <Picker
              selectedValue={selectedGender}
              style={styles.textInput}
              onValueChange={itemValue => setSelectedGender(itemValue)}>
              <Picker.Item label={''} value={''} />
              <Picker.Item label={'남성'} value={'남성'} />
              <Picker.Item label={'여성'} value={'여성'} />
            </Picker>
          </View>