Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some items turn gray when scrolling #445

Closed
Martomate opened this issue Jun 2, 2021 · 5 comments
Closed

Some items turn gray when scrolling #445

Martomate opened this issue Jun 2, 2021 · 5 comments

Comments

@Martomate
Copy link

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
Copy link
Author

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.

@basitmir
Copy link

any solution regarding this @Martomate

@Martomate
Copy link
Author

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.

@basitmir
Copy link

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

@lfkwtz
Copy link
Collaborator

lfkwtz commented Oct 23, 2023

dupe of #433 and #169

@lfkwtz lfkwtz closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants