react-native-picker-select icon indicating copy to clipboard operation
react-native-picker-select copied to clipboard

Control not showing values on Android with useNativeAndroidPickerStyle=true

Open jenniferburch opened this issue 4 years ago • 5 comments

Describe the bug
On Android, the control does not show a selected value if useNativeAndroidPickerStyle=true and no style is provided, the control is working otherwise (onValueChange is reporting successfully). Also note that using textInputProps is a work around.

To Reproduce
I've made a sample app here: https://github.com/jenniferburch/scratch-mobile/tree/picker-select

  1. npm install
  2. npm run start
  3. npm run android
  4. there will be five pickers on screen, the first one is not working

Expected behavior
As the items are selected in the picker their values should show up in the resulting control

Screenshots
Screen Shot 2020-09-24 at 11 55 23 AM

Additional details

  • Android only
  • react-native version v63.2
  • react-native-picker-select version v8.0
  • @react-native-community/picker v1.8.0"

Reproduction and/or code sample
https://github.com/jenniferburch/scratch-mobile/tree/picker-select

jenniferburch avatar Sep 24 '20 00:09 jenniferburch

+1

joaodematejr avatar Sep 28 '20 13:09 joaodematejr

I have the same problem, I don't even have the useNativeAndroidPickerStyle prop, and was not using any custom style. This does not work for me:

export const Dropdown = () => {
    return (
        <RNPickerSelect
            onValueChange={(value) => console.log(value)}
            items={[
                { label: 'Football', value: 'football' },
                { label: 'Baseball', value: 'baseball' },
                { label: 'Hockey', value: 'hockey' },
            ]}
        />
    );
};

This might be related with the upgrade with 0.63.3 the previous version was working without problems

This actually works: when I add useNativeAndroidPickerStyle={false} or even with true on the hot-reload only!

export const Dropdown = () => {
    return (
        <RNPickerSelect
            onValueChange={(value) => console.log(value)}
            useNativeAndroidPickerStyle={false}
            items={[
                { label: 'Football', value: 'football' },
                { label: 'Baseball', value: 'baseball' },
                { label: 'Hockey', value: 'hockey' },
            ]}
        />
    );
};

Update

It actually worked when I added a style.

misterpoloy avatar Nov 05 '20 19:11 misterpoloy

+1 Same here

It worked when I added style={ {inputAndroid: {color: 'black'} }} to the <RNPickerSelect>

Sixtisam avatar Nov 25 '20 13:11 Sixtisam

style={ {inputAndroid: {color: 'black'} }} is wotk for me to

rajan-keypress avatar Jan 21 '21 10:01 rajan-keypress

Great!! style={ {inputAndroid: {color: 'black'} }} is wotk for me to

hongdaeri avatar Jun 18 '21 02:06 hongdaeri