Skip to content

Commit

Permalink
fix: allow nested functions in Attribute (closes #2023)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Nov 15, 2023
1 parent cb7e074 commit 6a9fa9c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion leptos_dom/src/macro_helpers/into_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,13 @@ pub(crate) fn attribute_expression(
el.remove_attribute(attr_name).unwrap_throw();
}
}
_ => panic!("Remove nested Fn in Attribute"),
Attribute::Fn(f) => {
let mut v = f();
while let Attribute::Fn(f) = v {
v = f();
}
attribute_expression(el, attr_name, v, force);
}
}
}
}

0 comments on commit 6a9fa9c

Please sign in to comment.