File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ def convert_textarea_children_to_prop(vdom_tree: VdomDict) -> VdomDict:
2323 """Transformation that converts the text content of a <textarea> to the 'value' prop."""
2424 # If the current tag is <textarea>, move the text content to the 'value' prop.
2525 if vdom_tree ["tagName" ] == "textarea" and "children" in vdom_tree and vdom_tree ["children" ]:
26+ vdom_tree .setdefault ("attributes" , {})
2627 text_content = vdom_tree .pop ("children" )
2728 text_content = "" .join ([child for child in text_content if isinstance (child , str )])
2829 default_value = vdom_tree ["attributes" ].pop ("defaultValue" , "" )
@@ -36,6 +37,7 @@ def set_value_prop_on_select_element(vdom_tree: VdomDict) -> VdomDict:
3637 # If the current tag is <select>, remove 'selected' prop from any <option> children and
3738 # instead set the 'value' prop on the <select> tag.
3839 if vdom_tree ["tagName" ] == "select" and "children" in vdom_tree :
40+ vdom_tree .setdefault ("attributes" , {})
3941 selected_options = _find_selected_options (vdom_tree )
4042 multiple_choice = vdom_tree ["attributes" ]["multiple" ] = bool (vdom_tree ["attributes" ].get ("multiple" ))
4143 if selected_options and not multiple_choice :
You can’t perform that action at this time.
0 commit comments