Skip to content

Commit

Permalink
updated error message when trying to pass children to textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
its-the-shrimp committed Oct 19, 2023
1 parent 9ca375c commit a6ca242
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/yew-macro/src/html_tree/html_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Parse for HtmlElement {
open.to_spanned(),
"the tag `<textarea>` is a void element and cannot have children (hint: \
to provide default value to it, rewrite it as <textarea \
~defaultValue={x}/>",
defaultvalue={x}/>",
))
}

Expand Down
2 changes: 1 addition & 1 deletion packages/yew-macro/tests/html_macro/element-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ error: the tag `<input>` is a void element and cannot have children (hint: rewri
66 | html! { <input type="text"></input> };
| ^^^^^^^^^^^^^^^^^^^

error: the tag `<textarea>` is a void element and cannot have children (hint: to provide default value to it, rewrite it as <textarea ~defaultValue={x}/>
error: the tag `<textarea>` is a void element and cannot have children (hint: to provide default value to it, rewrite it as <textarea defaultvalue={x}/>
--> tests/html_macro/element-fail.rs:68:13
|
68 | html! { <textarea>{"default value"}</textarea> }
Expand Down

0 comments on commit a6ca242

Please sign in to comment.