JedWatson / JedWatson/react-select

Scroll position inside dropdown does not reflect selected value on first render

Open
#4,939 2 comments 8 reactions 1 assignee View on GitHub

@Rall3n is already working on this.

Since Dec 6, 2021.

issue/bug-confirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Hello 👋

This is a small bug with dropdown scroll position that is causing minor frustrations from a UX perspective.

On first render, scroll position in the dropdown always starts at the top, even when a default value is set (either via defaultValue or via value props).

Examples:

Screencap:

Kapture 2021-12-03 at 12 17 42


In the above gif, you can see that on first open "Wisconsin" is not visible in the dropdown list, instead scroll position starts at the top.

On the other hand, when selecting "Vermont" and reopening the dropdown, scroll position is behaving as expected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.