JedWatson / JedWatson/react-select
menu is wrongly placed at bottom
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
Are you reporting a bug or runtime error?
I think it's a bug. menuPosition is default (auto). When there is no enough space for menu, it still appears in the bottom. The reason is: In Menu.js, this getMenuPlacement will calculate a wrong menuHeight. In my situation, the menu will load data asynchrously, so it will display 'Loading' (loading message) in the menu first, then the data after it's loaded. But getMenuPlacement only calculates the height of 'Loading' and decides to put the menu at the bottom.
Expected
should calcuate the menuHeight when the data is loaded and decides the placement again.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Menu.js at getMenuPlacement and trace how the menu height is measured while asynchronous options are loading. Reproduce the case where the loading message is replaced by loaded data, then verify that auto placement is recalculated using the loaded menu height and no longer incorrectly moves the menu to the bottom.
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