JedWatson / JedWatson/react-select
Scroll position inside dropdown does not reflect selected value on first render
@Rall3n is already working on this.
Since Dec 6, 2021.
- 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:
- https://codesandbox.io/s/react-select-v5-sandbox-forked-372xo?file=/example.js
- https://codesandbox.io/s/angry-christian-17gw6?file=/src/App.js
Screencap:

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.