NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Andoid placeholder not work

Open ihusak opened this issue 8 years ago • 21 comments

  • 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 avatar Jul 20 '18 13:07 ihusak

@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 avatar Jul 30 '18 06:07 SupriyaKalghatgi

@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 avatar Jul 30 '18 15:07 ihusak

@ihusak I have stated above that

Android Picker does not support placeholder, documented

SupriyaKalghatgi avatar Aug 02 '18 05:08 SupriyaKalghatgi

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.

cseelus avatar Jan 26 '19 21:01 cseelus

It's already 2019, and Picker still not supporting placeholder in Android.

Luckygirlllll avatar Jul 04 '19 12:07 Luckygirlllll

It's already 2019, and Picker still not supporting placeholder in Android.

leyue avatar Aug 27 '19 08:08 leyue

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}

Rajdeepc avatar Oct 23 '19 11:10 Rajdeepc

It's already 2020, and Picker still not supporting placeholder in Android.

imransid avatar Dec 26 '19 21:12 imransid

It's already 2020, and Picker still not supporting placeholder in Android.

rinaharry avatar Jun 09 '20 13:06 rinaharry

Picker doesn't show placeHolder value in Android. <Picker mode="dropdown" iosIcon={} style={{ color: '#174A7A', fontSize: 20 }} placeholder="Select your Country*" placeholderStyle={{ color: "#bfc6ea", fontSize: 20 }} selectedValue={this.state.selected} onValueChange={this.onValueChange.bind(this)}>

SanjanaTailor avatar Jun 24 '20 06:06 SanjanaTailor

Picker placeholder doesn't work in Android.

alfahadp avatar Dec 02 '20 06:12 alfahadp

I think it's not going to be supported in android

rzfury avatar Jan 07 '21 05:01 rzfury

It's already 2021, and Picker still not supporting placeholder in Android.

jeffvwei avatar Jan 20 '21 20:01 jeffvwei

It's already 2021, and Picker still not supporting placeholder in Android

chamaldesilva avatar Jan 28 '21 09:01 chamaldesilva

It`s already February 2021 and Picker still not supporting placeholder in Android

bittu1028 avatar Feb 09 '21 12:02 bittu1028

It's already March 2021 and Picker still not supporting placeholder in Android

KiranC10 avatar Mar 26 '21 12:03 KiranC10

It's already April 2021 and Picker still not supporting placeholder in Android

deepakmehra96 avatar Apr 26 '21 09:04 deepakmehra96

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...

rabidkitten avatar May 08 '21 19:05 rabidkitten

It's already Jun 2022 and Picker still not supporting placeholder in Android , right?

iita71737 avatar Jun 23 '22 08:06 iita71737

It's 2023 and Picker still not supporting placeholder in android

WitchNagato avatar Mar 18 '23 10:03 WitchNagato