Skip to content

Commit

Permalink
Rebuild tree until observability is figured out
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz committed Jun 21, 2024
1 parent f2be9f3 commit a419383
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions packages/dioxus-blitz/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,26 @@ impl<'a, Doc: DocumentLike> View<'a, Doc> {
if !changed.is_empty() {
let doc = self.renderer.dom.as_ref();

let updates: Vec<_> = changed
.iter()
.map(|id| {
let node = doc.get_node(*id).unwrap();
(id, state.build_node(*id, node))
})
.collect();

let mut nodes = Vec::new();
for (id, (node_id, mut node)) in updates {
for child_id in &doc.get_node(*id).unwrap().children {
node.push_child(state.id_to_node_ids[child_id])
}
nodes.push((node_id, node.build()))
doc.visit(|node_id, node| {
let (id, node_builder) = state.build_node(node_id, node);
nodes.push((id, node_builder.build()));
});

let mut window = accesskit::NodeBuilder::new(accesskit::Role::Window);
for (id, _) in &nodes {
window.push_child(*id);
}
nodes.push((accesskit::NodeId(0), window.build()));

let tree = accesskit::Tree::new(accesskit::NodeId(0));
let tree_update = accesskit::TreeUpdate {
nodes,
tree: None,
tree: Some(tree),
focus: accesskit::NodeId(0),
};
state.adapter.update_if_active(|| tree_update);

state.adapter.update_if_active(|| tree_update)
}

true
Expand Down

0 comments on commit a419383

Please sign in to comment.