fix: less aggressive widget state tree diffing
responsive widget requires that diffing not reset state tree when number of child widgets change. I worry that this could cause regressions in some apps, but otherwise responsive widgets will discard state for their contents without an id container
This commit is contained in:
parent
14cefe034e
commit
40b6bfe9ca
1 changed files with 1 additions and 8 deletions
|
|
@ -203,9 +203,7 @@ impl Tree {
|
|||
{
|
||||
std::mem::swap(&mut self.state, &mut state);
|
||||
let widget_children = borrowed.children();
|
||||
if !tag_match
|
||||
|| self.children.len() != widget_children.len()
|
||||
{
|
||||
if !tag_match {
|
||||
self.children = widget_children;
|
||||
} else {
|
||||
for (old_i, mut old) in children {
|
||||
|
|
@ -244,11 +242,6 @@ impl Tree {
|
|||
if let Some(id) = self.id.clone() {
|
||||
borrowed.set_id(id);
|
||||
}
|
||||
let borrowed_children = borrowed.children();
|
||||
|
||||
if self.children.len() != borrowed_children.len() {
|
||||
self.children = borrowed_children;
|
||||
}
|
||||
}
|
||||
}
|
||||
if tag_match {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue