diff --git a/leptos_macro/src/view/mod.rs b/leptos_macro/src/view/mod.rs index 77fbb7d566..6d597c0586 100644 --- a/leptos_macro/src/view/mod.rs +++ b/leptos_macro/src/view/mod.rs @@ -547,10 +547,12 @@ pub(crate) fn attribute_absolute( node: &KeyedAttribute, after_spread: bool, ) -> Option { - let contains_dash = node.key.to_string().contains('-'); + let key = node.key.to_string(); + let contains_dash = key.contains('-'); + let attr_aira = key.starts_with("attr:aria-"); // anything that follows the x:y pattern match &node.key { - NodeName::Punctuated(parts) if !contains_dash => { + NodeName::Punctuated(parts) if !contains_dash || attr_aira => { if parts.len() >= 2 { let id = &parts[0]; match id { @@ -566,6 +568,14 @@ pub(crate) fn attribute_absolute( Some( quote! { ::leptos::tachys::html::#key::#key(#value) }, ) + } else if key_name == "aria" { + let mut parts_iter = parts.iter(); + parts_iter.next(); + let fn_name = parts_iter.map(|p| p.to_string()).collect::>().join("_"); + let key = Ident::new(&fn_name, key.span()); + Some( + quote! { ::leptos::tachys::html::attribute::#key(#value) }, + ) } else { Some( quote! { ::leptos::tachys::html::attribute::#key(#value) },