-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update from v0.9.1 to v0.9.3 CSS bug #422
Comments
I'm unable to reproduce both of the bugs. Can you record a video and post it here so I can see exactly what you are doing in order to repro it? |
Here I have reproduced bug 2, I have opened and closed the drawer very quickly. It does not happen every time and is sometimes hard to reproduce. As you can see, pointer-events: none remains on body, even though my drawer is closed, rendering the app uninteractive until page reload |
I hope you revert the changes please! |
I have the exact same issue. It drove me crazy for a few minutes thinking I had some other issue as my page seemed unresponsive! This a quite a nasty little bug, please fix asap. I reverted back and I no longer see the issue. |
Can you provide a demo with reproduction? The exact props you are using etc. The black background won't be added unless you have This codesandbox runs on 0.9.3, it's the default setup. https://codesandbox.io/p/devbox/drawer-with-scale-forked-nx2glp Are you able to reproduce it there? |
@maiconcarraro Thank you so much for this reproductions and explanations. I changed Once again thanks @maiconcarraro for this great explanation. |
@emilkowalski for this specific bug your change related to The problem is the difference for this logic (from your PR: https://github.com/emilkowalski/vaul/pull/409/files) Having no wrapper would return early and apply no styling, whereas the new version applies style even if wrapper is null. |
I don't think it's really a problem of vaul 0.9.3, the real problem is the misconfiguration using |
I agree that this is a configuration issue. Consequences of this misconfiguration where avoided before, because we returned early if there was no wrapper even if |
@emilkowalski same page ✅ |
Could the bug 2 (issue of failing to remove the modifier on drawer close) be attributed to the use of React.useEffect()? |
What |
You are setting background: black inside React.useEffect() inside the code highlighted in green. If this is new, meaning you did not set the CCS modifier inside React.UseEffect() before, but you are now, in v0.9.3, I suggest that this is the cause for bug 2. |
@vartdalen this library has no directly relation to the "pointer-events: none" logic, this is set by radix dialog and this bug might happen if you are using different versions of radix, you just try to follow up there, example of a very similar issue there: [Dialog] body pointer-events: none remains after closing #1241 |
The depicted reproduction of bug 2 does not involve bumping radix dialog, only vaul from v0.9.1 to v0.9.3 |
I underline that in v0.9.1, opening and closing the drawer is not only avoiding the pointer event bug. It is also snappier and more reactive to quickly opening and closing the drawer in succession. |
@vartdalen Again, please provide a codesandbox demo with reproduction. I don't know what your exact setup is and this is critical for me to debug it. |
the only thing that could be related to this is this specific bump to radix dialog version: https://github.com/emilkowalski/vaul/pull/408/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L66 so depending on what you have in your project you may have conflicts if you are not enforcing the same version, in my project I also have (using this since vaul 0.9.0 to solve a problem w/ cmdk and other libs) @vartdalen can you reproduce using the sandbox I sent few messages above? |
@vartdalen to remove the weird black background, add |
can confirm. adding |
I've updated Vaul's version to 0.9.4 where you can keep |
Thanks for updating, Emil. Cheers! |
2024-09-26_10-05-13-2.mp4 |
This is on purpose. It is now using CSS animations instead of CSS transitions and pointer events none are set on the body until the drawer fully closes, that's how Radix's Dialog work. |
"bug" 1:
Causes "background: black" to be applied to body by JavaScript (not with className) on Drawer open.
Applying black to background must be reverted or at least should be opt in.
bug 2:
Causes "pointer events: none" to be applied to by JavaScript (not with className) on Drawer open.
If I open the Drawer and quickly close it by clicking on the background right away, pointer events: none is not removed from body, rendering the app uninteractive until page refresh or manual disabling of the CSS modifier.
I have reverted to v0.9.1 until further notice.
This is a great library, much love from a big fan
The text was updated successfully, but these errors were encountered: