Fix partially formatted if chains in attributes (#2999)

This commit is contained in:
Evan Almloff authored and GitHub committed 2024-10-09 13:48:33 -05:00
1 parent d64df87aba
commit a693ddffa3
2 files changed
+28

No files matched your search

@@ -0,0 +1,13 @@
use dioxus::prelude::*;
/// Make sure that rsx! handles conditional attributes with one formatted branch correctly
/// Regression test for https://github.com/DioxusLabs/dioxus/issues/2997
#[test]
fn partially_formatted_conditional_attribute() {
let width = "1px";
_ = rsx! {
div {
width: if true { "{width}" } else { "100px" }
}
};
}