fix for event handlers in py3.9 (#4416)

This commit is contained in:
Thomas Brandého 2024-11-21 12:41:48 -08:00 committed by GitHub
parent e0984aa834
commit d4b197b517
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -12,7 +12,9 @@ from reflex.vars.base import Var
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:

View File

@ -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
@ -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,