Some items turn gray when scrolling
Describe the bug
When there are many items in the dropdown some items turn gray as if they are selected. This happens when it's possible to scroll and the gray items are the ones who appear when you scroll. Items can even turn back to black again after scrolling up and down some more.
This is the same issue as #433.
To Reproduce
Steps to reproduce the behavior:
- Open the dropdown
- Scroll down
- Some of the now visible items might be gray
- Scroll up
- Some of the top items might now have turned gray
Expected behavior
Only the selected item should be gray
Screenshots
See #433 for a screen shot
Additional details
- Device: Galaxy Tab A
- OS: Android 10
- react-native-picker-select version: 8.0.4
- @react-native-picker/picker version: 1.15.0
- react-native version: 0.60.5
- expo sdk version: n/a
Reproduction and/or code sample
const options = [...Array(20).keys()].map(m => ({ value: m, label: `${m}` }));
<Select items={options} onValueChange={console.log} />
Apparently this problem could be fixed by simply adding a placeholder to the Select. The bug still exists of course, but this is a viable solution for us.
any solution regarding this @Martomate
The workaround that worked for us was to add placeholder={{ label: strings.select, value: null }} to the Select tag (which was imported using import Select from 'react-native-picker-select'). We haven't looked more into it since my collegue found this workaround, so I don't have any new information to give. There is no new version of this library so it's probably not fixed yet.
The workaround that worked for us was to add
placeholder={{ label: strings.select, value: null }}to theSelecttag (which was imported usingimport Select from 'react-native-picker-select'). We haven't looked more into it since my collegue found this workaround, so I don't have any new information to give. There is no new version of this library so it's probably not fixed yet.
Thank you for the reply @Martomate yes I think this is the workaround for it i.e by not setting the color for placeholder
dupe of #433 and #169