Andoid placeholder not work
- node - v8.9.4
- npm - v5.6.0
- react-native - 0.53.0
- react - v16.2.0
- native-base - v2.4.5
Expect
Show placeholder on Android, iOS works well
Result
Show first Picker.Item element
I changed to default <Picker.Item label={label]} value={null}/> and show this now, but I need remove that item for current work
@ihusak Android Picker does not support placeholder, documented
I changed to default <Picker.Item label={label]} value={null}/> and show this now, but I need remove that item for current work
I did not get this, can you be more clear
@SupriyaKalghatgi I added <Picker.Item label={label]} value={null}/> and it's added me another item to my checklist, but user can choose it and send value null, I write some function to prevent errors. But placeholder will be perfect solve for this task
@ihusak I have stated above that
Android Picker does not support placeholder, documented
I created my own Picker Component (abstracting away the Native Base Picker) which has an option to display a Placeholder both for Android and iOS by inserting a 'Please select …' option to the options array. Upon selection of a Picker Item, this additional 'Please select …' options gets removed.
Quite simple really.
I think this same approach could be used by Native Base itself to get feature parity regarding the Picker Placeholder between iOS and Android.
It's already 2019, and Picker still not supporting placeholder in Android.
It's already 2019, and Picker still not supporting placeholder in Android.
You can do like this:
//return each items after mapping over the list items const selectionItems = props.selectionList.map((item, index) => { return <Picker.Item key={index + 1} label={item.code ? item.name : item} value={item} />; }) // this is the important part. put the placeholder value in the array by appending the value at the beginning of the array. Since placeholder prop is not selected in Android. selectionItems.unshift(<Picker.Item key={0} label={props.placeholder} color={colors.primaryGrey} />) <Picker mode="dropdown" placeholder={props.placeholder}
{selectionItems}
It's already 2020, and Picker still not supporting placeholder in Android.
It's already 2020, and Picker still not supporting placeholder in Android.
Picker doesn't show placeHolder value in Android.
<Picker
mode="dropdown"
iosIcon={
Picker placeholder doesn't work in Android.
I think it's not going to be supported in android
It's already 2021, and Picker still not supporting placeholder in Android.
It's already 2021, and Picker still not supporting placeholder in Android
It`s already February 2021 and Picker still not supporting placeholder in Android
It's already March 2021 and Picker still not supporting placeholder in Android
It's already April 2021 and Picker still not supporting placeholder in Android
I can see a trend developing here. I think perhaps @SupriyaKalghatgi you should open the issue again. It's May 2021 and it's not supporting the placeholder in Android...
It's already Jun 2022 and Picker still not supporting placeholder in Android , right?
It's 2023 and Picker still not supporting placeholder in android