JedWatson / JedWatson/react-select

menuPlacement="auto" doesn't work if start search from 1 character

Open
#5,807 1 comment 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

Hello!

It appears that the custom Menu, along with menuPlacement="auto" and menuPosition="fixed", consistently positions the menu below whenever it's rendered under certain conditions. In my situation, I need to show menu when at least one character is inputted.

Here is a demo:
https://codesandbox.io/s/react-select-v5-sandbox-forked-vlxzm2?file=/example.js

image

Note. For the old version of react-select it works as expected. Example:

image

https://codesandbox.io/s/react-select-menu-placement-forked-xh336l?file=/src/App.js

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 CodeSandbox demo's example.js and the older-version src/App.js reproduction, then trace the custom Menu behavior for menuPlacement="auto" and menuPosition="fixed" in the react-select source. Reproduce starting a search with one character and compare both demos; done means the menu chooses the appropriate placement instead of consistently rendering 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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.