JedWatson / JedWatson/react-select

menuplacement auto in div with overflow not correct

Open
#4,108 15 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Menuplacement auto in a div with overflow auto, puts the menu to the bottom. Even when there is not enough space. This makes the form or div scrollable when it doesn't need to. This occurs when the select is put on the bottom of the form.

Examples:
Schermafbeelding 2020-07-03 om 14 59 50

Schermafbeelding 2020-07-03 om 15 02 21
This screenshot comes from my CodeSandBox: https://codesandbox.io/s/react-select-menu-placement-479mi?file=/src/App.js:405-410

Version used: 3.1.0

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 linked CodeSandbox reproduction, particularly src/App.js around lines 405-410, and reproduce the select at the bottom of an overflow-auto container using menuPlacement="auto". Trace the menu-placement behavior in react-select and verify that auto placement avoids making the container scrollable when there is insufficient space below.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.