JedWatson / JedWatson/react-select

react-select does not scroll into view selected option when `menuPortalTarget={document.body}`

Open
#5,775 5 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

react-select does not scroll into view selected option when
we use menuPortalTarget={document.body}

In docs example:
https://react-select.com/advanced#portaling

Or please check this codesandbox:
https://codesandbox.io/s/codesandboxer-example-forked-c5xp8p?file=/example.tsx

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

Reproduce the issue using the Advanced portaling documentation example or the linked CodeSandbox. Compare selected-option behavior with and without menuPortalTarget={document.body}, then trace the relevant TypeScript component and tests. Done means the selected option scrolls into view when the menu is portaled, with existing behavior preserved otherwise.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.