JedWatson / JedWatson/react-select

Menu placement is calculated incorrectly if scrollParent has a fixed height

Open
#5,795 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/JedWatson/react-select/blob/2f94e8d228ea32dbd0faa1f7685a67b74c70420f/packages/react-select/src/components/Menu.tsx#L96
Since scrollHeight is the normal block height (not the block's scroll height), scrollSpaceBelow is calculated incorrectly for a fixed-height element.

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 at packages/react-select/src/components/Menu.tsx around line 96 and inspect how scrollSpaceBelow is derived when the scrollParent has a fixed height. Reproduce the menu placement with a fixed-height scrollParent, then verify that the calculated space below matches the available scrollable area and that placement is corrected without affecting normal containers.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.