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

Some items turn gray when scrolling

Open Martomate opened this issue 4 years ago • 4 comments

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:

  1. Open the dropdown
  2. Scroll down
  3. Some of the now visible items might be gray
  4. Scroll up
  5. 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} />

Martomate avatar Jun 02 '21 10:06 Martomate

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.

Martomate avatar Jun 30 '21 07:06 Martomate

any solution regarding this @Martomate

basitmir avatar Aug 27 '21 07:08 basitmir

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.

Martomate avatar Aug 27 '21 11:08 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.

Thank you for the reply @Martomate yes I think this is the workaround for it i.e by not setting the color for placeholder

basitmir avatar Aug 28 '21 08:08 basitmir

dupe of #433 and #169

lfkwtz avatar Oct 23 '23 17:10 lfkwtz