JedWatson / JedWatson/react-select

Using control props menuIsOpen does not scroll menu to selected option

Open
#3,344 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,

I would like to report a possible bug.

I have noticed that when using controlled props, the menu list is not scrolled to the selected option. This is reproducible on your site on the controlled-props example https://react-select.com/advanced#controlled-props . If you select the last option from the example (Silver), close the menu and then open it again, the menu is not scrolled at the bottom. However, this feature is functional when you don't use controlled props (eg. https://react-select.com/advanced#accessing-internals any example).

Any help would be much appreciated!
Thank you!

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.

Research direction

Start with the controlled-props example at react-select.com/advanced#controlled-props and reproduce the issue by selecting Silver, closing the menu, and reopening it. Compare its behavior with an example under react-select.com/advanced#accessing-internals. Done means the controlled menu reopens scrolled to the selected option, as the uncontrolled example does.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.