Replace renamed Var.type_ with _var_type (#2039)
This commit is contained in:
parent
5d590c350e
commit
21dbdc0103
@ -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",
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user