From 418f4a792552c96d43b0d16af1b2d8b8795c2ca8 Mon Sep 17 00:00:00 2001 From: Tom Gotsman Date: Tue, 29 Oct 2024 18:11:09 +0000 Subject: [PATCH] fix hover card and alert dialog final --- reflex/components/radix/themes/components/alert_dialog.py | 3 +++ reflex/components/radix/themes/components/hover_card.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/reflex/components/radix/themes/components/alert_dialog.py b/reflex/components/radix/themes/components/alert_dialog.py index f3c8ec319..12ac64b90 100644 --- a/reflex/components/radix/themes/components/alert_dialog.py +++ b/reflex/components/radix/themes/components/alert_dialog.py @@ -24,6 +24,9 @@ class AlertDialogRoot(RadixThemesComponent): # Fired when the open state changes. on_open_change: EventHandler[identity_event(bool)] + # The open state of the dialog when it is initially rendered. Use when you do not need to control its open state. + default_open: Var[bool] + class AlertDialogTrigger(RadixThemesTriggerComponent): """Wraps the control that will open the dialog.""" diff --git a/reflex/components/radix/themes/components/hover_card.py b/reflex/components/radix/themes/components/hover_card.py index 9b6ad0c6b..8e247027d 100644 --- a/reflex/components/radix/themes/components/hover_card.py +++ b/reflex/components/radix/themes/components/hover_card.py @@ -1,6 +1,6 @@ """Interactive components provided by @radix-ui/themes.""" -from typing import Literal, Union +from typing import Literal, Union, Dict from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive @@ -62,7 +62,7 @@ class HoverCardContent(elements.Div, RadixThemesComponent): avoid_collisions: Var[bool] # The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { top: 20, left: 20 }. - collision_padding: Var[Union[int, dict[str, int]]] + collision_padding: Var[Union[float, int, Dict[str, Union[float, int]]]] # The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless sticky: Var[Literal["partial", "always"]]