JedWatson / JedWatson/react-select

Scroll option into view while using portals

Open
#5,663 0 comments 0 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

Description

I've stumbled upon a bug where the "scroll option into view" feature does not work for portaled menus.
Although, it seems to work fine for non-portaled menus.

Affected Versions

I've found this issue to have been introduced in v4, and it is still present in v5.

Screen recording

a gif of the bug

How to reproduce the bug

  • Open the official docs
    • The same can be reproduced on the Storybook
  • Navigate to Advanced > Portaling
  • Open the Modal and its inner Menu
  • Scroll down and pick an option that is outside of the initial scroll position
    • The last option for example - Silver
  • Close the menu and open it again
  • The menu will not scroll back to the selected option

What is the expected behavior

The menu should scroll back to the selected option

Notes

I have taken a look into the code and did not manage to find the issue. I wouldn't mind doing the PR myself if anyone can manage to point me in the right direction.

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 in the official docs or Storybook under Advanced > Portaling, using the Modal and its inner menu. Compare portaled and non-portaled menu behavior when reopening after selecting Silver or another off-screen option. Done means the selected option is scrolled back into view for portaled menus as it is for non-portaled menus.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.