The dynamic rendering of the if-expression does not work if the expressions are Fragments. If the Fragments are replaced by divs, everything works as expected.
Steps To Reproduce
In the following example, the paragraph does not update to "input not empty" as it should.
#![allow(non_snake_case)]
use dioxus::prelude::*;
fn main() {
launch(App);
}
fn App() -> Element {
let mut signal = use_signal(|| String::new());
rsx! {
input {
value: signal(),
oninput: move |evt| {
signal.set(evt.value());
}
}
if signal().is_empty() {
Fragment {
p { "input empty!" }
}
} else {
Fragment {
p { "input not empty!" }
}
}
}
}
Expected behavior
The rendered content should be updated if the signal is updated and is not empty.
Problem
The dynamic rendering of the if-expression does not work if the expressions are
Fragment
s. If theFragment
s are replaced bydiv
s, everything works as expected.Steps To Reproduce
In the following example, the paragraph does not update to "input not empty" as it should.
Expected behavior
The rendered content should be updated if the signal is updated and is not empty.
Environment:
web