Open btnalexandre opened 3 months ago
Also, @btnalexandre, if the page has a vertical scroll, the body will have a negative top value. It affects the positioning of other items. Here: https://github.com/emilkowalski/vaul/blob/a30da7d1618afd8b33637982695f0676130346ff/src/use-position-fixed.ts#L35
So I think the bug is because that's not being set.
Yeah thanks @adebiyial for the tips 🙂 ! So only the developer of this lib can correct this?
Hello everyone!
I've noticed a bug in the lib that doesn't allow scroll persistence in some cases when I open the drawer.
Case without bug (codesandbox)
However, when the body has a height of 100% in the css, the lib overwrites the value by changing it to
auto
when opening. This causes scrolling to be lost and the page scrolls to the top of the page.Case with bug (codesandbox)
In this case the
height: 100%;
is set to thebody
(file : globals.css)The temporary solution I had to adopt in my project is to add
!important
to theheight: 100%
property in body, which keeps the initial position persistent when the drawer is opened.Thanks !