You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We have a drawer with input text box to update a value show on page. When user click an update button in drawer, it'll call an alert dialog to ask user to confirm the updated information. If user click yes, then the data will be updated and show on page.
However, after the drawer and alert dialog is closed, the page freezes and we cannot click anything without refreshing page.
Same issue happens when change drawer into a dialog.
This bug occurs when updating reflex to v0.6.6. Before v0.6.6, the page won't freeze.
We check in developer tool, it seems that on body, the style property pointer-events is still set to none after drawer and alert dialog are closed. It seems to be the root cause.
This appears to be caused by a bug in the frontend library that reflex uses, @radix-ui/themes, that is exposed in the Vaul drawer when used with modal=False and controlled open: emilkowalski/vaul#492
The problem you're seeing is fixed in the upstream v3.1.6. However in reflex v0.6.5 we pinned @radix-ui/themes to <3.1.5 because they introduced 2 regressions: one in scroll area width and one in dialog flickering on close. Until those bugs are fixed, reflex is stuck on the older versions of @radix-ui/themes.
So what can be done to workaround?
--- repro_page_freeze/repro_page_freeze.py.orig 2024-12-13 14:56:51+++ repro_page_freeze/repro_page_freeze.py 2024-12-13 16:10:32@@ -1,5 +1,9 @@
import reflex as rx
+fix_pointer_events_hack = rx.Var(+ "(open) => {!open && window.setTimeout(() => (document.body.style.pointerEvents = 'auto'), 200)}",+ _var_type=rx.EventChain,+)
class State(rx.State):
"""The app state."""
\ No newline at end of file
@@ -94,6 +98,7 @@
),
),
open=show_alert,
+ on_open_change=fix_pointer_events_hack,
)
We can use a bit of javascript to reset the CSS after some delay 🤷 it's not pretty, but it's possible.
Hopefully we'll be able to update our @radix-ui/themes package soon and then the hack can also go away.
Describe the bug
We have a drawer with input text box to update a value show on page. When user click an update button in drawer, it'll call an alert dialog to ask user to confirm the updated information. If user click yes, then the data will be updated and show on page.
However, after the drawer and alert dialog is closed, the page freezes and we cannot click anything without refreshing page.
Same issue happens when change drawer into a dialog.
This bug occurs when updating reflex to
v0.6.6
. Beforev0.6.6
, the page won't freeze.We check in developer tool, it seems that on body, the style property
pointer-events
is still set tonone
after drawer and alert dialog are closed. It seems to be the root cause.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Page should not freeze.
Screenshots
Specifics (please complete the following information):
The text was updated successfully, but these errors were encountered: