Closed maelp closed 9 months ago
it also adds this "focus guard" element
or perhaps due to useBodyScrollLock
?
https://github.com/radix-vue/shadcn-vue/assets/15458/f1f2e1a7-1099-4a6a-acbd-a9c1124fe7e8
this is a screen recording to show the annoying effect, which causes a resize each time I open or close a dropdown, anywhere on the page (not necessarily against a border)
Based on the main radix-ui
they also block the scroll with react-remove-scroll-bar and add your custom scrollbar size as a CSS variable to the body,
So you could fix other layout shifts in the elements with absolute or fixed positions
I think blocking scroll when the dropdown is open is a good decision they made cause it prevents redundant FloatingUI
calculation for positioning stuff
I think there is some issue with your layout, we can help if you share your Live Site
hmmmm... so I guess there's an error in the setting of the scrollbar size? where can I set it? it must depend on the OS/browser no?
you can see the website at https://builder.gouach.com/
Add mr-[--scrollbar-width]
or me-[--scrollbar-width]
to this class fixed left-[450px] right-2 h-[85vh]
Also radix-vue
Popover still has some bugs It will pops out of the screen
only shadcn-solidjs
Dropdown (Popover) looks fine on mobile and desktop on the edge of the screen
@sadeghbarati thanks this works! Can you explain to me why this works? why should I add this mr- class right at this place, and not to other component in my layout, and what was "broken" initially?
(and perhaps there's a better way to do my "fixed editor" layout with the top navbar, the fixed editor on the side, and the scrolling column on the right? but the only "hack" I found to make it work was to use this fixed
classes)
Try sticky
position with top: (size of your header)
That’s what I wanted to do originally, but unfortunately the size of the header is variable (on mobile some buttons go to next line, etc)
@maelp Try doing ":modal="false" to your DropdownMenu component
in some cases modal prop doesn't works on dropdown (sveltekit) overiding the CSS can be also give quick fix
html body { overflow: auto !important; padding-right: 0 !important; }
Environment
Link to minimal reproduction
Any dropdown
Steps to reproduce
When I click on a dropdown it seems to add those classes to
<body>
which messes with the layout, not sure where this comes from?Describe the bug
This changes the layout (add padding, etc) so it messes with the rendering and is annoying
Expected behavior
The
<body>
style shouldn't change when opening a dropdownConext & Screenshots (if applicable)
No response