ui: [bug]: Select removes scrollbar
Describe the bug
When using a select somewhere and the body has a scrollbar, this scrollbar gets removed as soon as the select is used.
Affected component/components
Select
How to reproduce
- Give the body a scrollbar
- Add a Select
- Open the Select
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
Chrome
Before submitting
- I’ve made research efforts and searched the documentation
- I’ve searched for existing issues
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 23
- Comments: 15
This one worked for me - no layout shift and scroll still visible
it doesnt fixed yet? select is a very usefull and this bug is make the whole package useless…
I found a solution, but I don’t know if it’s the right way…
Hey friends 👋
This seems to be a known feature of the Radix UI select component. See this comment from a similar issue raised for Radix UI.
One thing you can try is using a popover instead of a select! 😄
You just add a select to any project and open it, you see your scrollbar dissappearing
would be great to have a similar solution as the DropdownMenu component with the props
modal={false}https://www.radix-ui.com/primitives/docs/components/dropdown-menu#root
For me is not removing the scrollbar but adding the margin (causing layout shift) I fixed it with https://github.com/shadcn-ui/ui/issues/4227#issuecomment-2438290165