lawnstarter / react-native-picker-select

🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
https://npmjs.com/package/react-native-picker-select
MIT License
1.74k stars 499 forks source link

Callback function for placeholder click #372

Closed kowshika05 closed 3 years ago

kowshika05 commented 3 years ago

Describe the bug
I'm adding a placeholder in my picker, It is showing in items list also. Is there any way to achieve a callback while clicking on a placeholder?

This is my code,

` <RNPickerSelect

            style={{
              inputAndroid: styles.inputAndroid,
              placeholder: styles.placeholderStyle,
            }}
            placeholderTextColor={Colors.coolGrey}
            placeholder={{label: placeholder}}
            value={value}
            onValueChange={this.onChangeDropdown}
            useNativeAndroidPickerStyle={false}
            items={data}
            Icon={this.dropDownArrowView}
          />`

Additional details

lfkwtz commented 3 years ago

what about having your onValueChange detect the value of the placeholder to call a different function?

lfkwtz commented 3 years ago

closing due to inactivity