Skip to content

Commit 9c0eb70

Browse files
committed
fix: Close dialog when transitioning to calendar overlay
1 parent 0e31b24 commit 9c0eb70

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

reflex_ui/blocks/demo_form.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,11 @@ def submit_step_3(self, form_data: dict[str, Any]):
287287
self.is_loading = False
288288
self.show_calendar = True
289289

290-
# Send Slack notification
291-
return DemoFormState.send_enterprise_notification()
290+
# Send Slack notification and close dialog
291+
return [
292+
DemoFormState.send_enterprise_notification(),
293+
rx.call_script("document.querySelector('[role=dialog] button[aria-label=Close]')?.click()"),
294+
]
292295

293296
@rx.event
294297
def go_back(self):
@@ -885,11 +888,7 @@ def demo_form_dialog(trigger: rx.Component | None, **props) -> rx.Component:
885888
class_name="h-fit mt-1 overflow-hidden w-full max-w-md",
886889
),
887890
),
888-
open=rx.cond(
889-
DemoFormState.show_calendar,
890-
False,
891-
demo_form_open_cs.value,
892-
),
891+
open=demo_form_open_cs.value,
893892
on_open_change=demo_form_open_cs.set_value,
894893
class_name=class_name,
895894
**props,

0 commit comments

Comments
 (0)