Skip to content

Commit

Permalink
fix for event handlers in py3.9 (#4416)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lendemor authored Nov 21, 2024
1 parent e0984aa commit d4b197b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from ..base import LiteralAccentColor, RadixThemesComponent


def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]:
def on_value_change(
value: Var[Union[str, List[str]]],
) -> Tuple[Var[Union[str, List[str]]]]:
"""Handle the on_value_change event.
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ from reflex.vars.base import Var

from ..base import RadixThemesComponent

def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: ...
def on_value_change(
value: Var[Union[str, List[str]]],
) -> Tuple[Var[Union[str, List[str]]]]: ...

class SegmentedControlRoot(RadixThemesComponent):
@overload
Expand Down Expand Up @@ -118,7 +120,10 @@ class SegmentedControlRoot(RadixThemesComponent):
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[[], BASE_STATE]] = None,
on_change: Optional[
Union[EventType[[], BASE_STATE], EventType[[str | List[str]], BASE_STATE]]
Union[
EventType[[], BASE_STATE],
EventType[[Union[str, List[str]]], BASE_STATE],
]
] = None,
on_click: Optional[EventType[[], BASE_STATE]] = None,
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
Expand Down

0 comments on commit d4b197b

Please sign in to comment.