mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
parent
d803df9336
commit
a9ab085e74
@ -428,8 +428,9 @@ impl ToTokens for HtmlElement {
|
||||
#[allow(clippy::redundant_clone, unused_braces, clippy::let_and_return)]
|
||||
let mut #vtag = match () {
|
||||
_ if "input".eq_ignore_ascii_case(::std::convert::AsRef::<::std::primitive::str>::as_ref(&#vtag_name)) => {
|
||||
::yew::virtual_dom::VTag::__new_textarea(
|
||||
::yew::virtual_dom::VTag::__new_input(
|
||||
#value,
|
||||
#checked,
|
||||
#node_ref,
|
||||
#key,
|
||||
#attributes,
|
||||
@ -465,7 +466,8 @@ impl ToTokens for HtmlElement {
|
||||
// For literal tags this is already done at compile-time.
|
||||
//
|
||||
// check void element
|
||||
if !::std::matches!(
|
||||
if ::yew::virtual_dom::VTag::children(&#vtag).is_some() &&
|
||||
!::std::matches!(
|
||||
::yew::virtual_dom::VTag::children(&#vtag),
|
||||
::std::option::Option::Some(::yew::virtual_dom::VNode::VList(ref #void_children)) if ::std::vec::Vec::is_empty(#void_children)
|
||||
) {
|
||||
|
||||
@ -60,4 +60,10 @@ fn main() {
|
||||
}
|
||||
}/>
|
||||
};
|
||||
|
||||
let input_tag = "input";
|
||||
let input_dom = ::yew::html! { <@{input_tag} /> };
|
||||
assert!(
|
||||
::std::matches!(input_dom, ::yew::virtual_dom::VNode::VTag(ref vtag) if vtag.tag() == "input")
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user