From 21dbdc0103f902b5027debe0e298141ea984bce2 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 26 Oct 2023 12:34:00 -0700 Subject: [PATCH] Replace renamed Var.type_ with _var_type (#2039) --- integration/test_form_submit.py | 4 ++++ reflex/components/forms/radio.py | 2 +- reflex/components/forms/select.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/integration/test_form_submit.py b/integration/test_form_submit.py index a9611ecc1..ebaec955b 100644 --- a/integration/test_form_submit.py +++ b/integration/test_form_submit.py @@ -16,6 +16,8 @@ def FormSubmit(): class FormState(rx.State): form_data: dict = {} + var_options: list[str] = ["option3", "option4"] + def form_submit(self, form_data: dict): self.form_data = form_data @@ -39,7 +41,9 @@ def FormSubmit(): rx.slider(id="slider_input"), rx.range_slider(id="range_input"), rx.radio_group(["option1", "option2"], id="radio_input"), + rx.radio_group(FormState.var_options, id="radio_input_var"), rx.select(["option1", "option2"], id="select_input"), + rx.select(FormState.var_options, id="select_input_var"), rx.text_area(id="text_area_input"), rx.input( id="debounce_input", diff --git a/reflex/components/forms/radio.py b/reflex/components/forms/radio.py index 3ee8e7b4e..81fdcb262 100644 --- a/reflex/components/forms/radio.py +++ b/reflex/components/forms/radio.py @@ -50,7 +50,7 @@ class RadioGroup(ChakraComponent): if ( len(children) == 1 and isinstance(children[0], Var) - and _issubclass(children[0].type_, List) + and _issubclass(children[0]._var_type, List) ): children = [Foreach.create(children[0], lambda item: Radio.create(item))] return super().create(*children, **props) diff --git a/reflex/components/forms/select.py b/reflex/components/forms/select.py index 15f132ba8..ffca7758a 100644 --- a/reflex/components/forms/select.py +++ b/reflex/components/forms/select.py @@ -76,7 +76,7 @@ class Select(ChakraComponent): if ( len(children) == 1 and isinstance(children[0], Var) - and _issubclass(children[0].type_, List) + and _issubclass(children[0]._var_type, List) ): children = [Foreach.create(children[0], lambda item: Option.create(item))] return super().create(*children, **props)