JedWatson / JedWatson/react-select
Wrong menu position when used in shadow dom
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
I am using different react components from different component libraries and react-select is the only one which does not fully work in web components with shadow dom enabled. In my case the menu of react-select has a wrong position. I tried similar components of other libraries that also render a menu, but I did not have any problems with them. So I guess that the calculation of the position of the menu is a bit buggy, especially when used in web components. Or maybe I am missing some property which could solve my issue.
You can check my code here: https://codesandbox.io/s/react-select-with-shadow-dom-and-menuportaltarget-n03fe?file=/src/ReactSelectElement.js
So is this a bug or is there some way I could fix my issue?
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 with the linked CodeSandbox, especially src/ReactSelectElement.js, and reproduce the menu-positioning behavior inside a shadow DOM. Compare the rendered position with the expected placement and determine whether an existing property addresses it; done means the menu is positioned correctly in the reported setup or the limitation is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100