-
-
Notifications
You must be signed in to change notification settings - Fork 830
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix partially formatted if chains in attributes (#2999)
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" } | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters