update the web renderer to the new dioxus core

This commit is contained in:
Evan Almloff committed 2024-01-06 16:44:07 -06:00
1 parent f4af297777
commit 88e2da6c11
10 files changed
+274 -204

No files matched your search

+1 -1
View File
@@ -128,7 +128,7 @@ pub trait WriteMutations {
/// Push the given root node onto our stack.
///
/// Id: The ID of the root node to push.
fn push_root(&mut self, _id: ElementId);
fn push_root(&mut self, id: ElementId);
/// Swap to a new subtree
fn swap_subtree(&mut self, _subtree_index: usize) {}
+18 -3
View File
@@ -12,7 +12,12 @@ fn events_propagate() {
_ = dom.rebuild();
// Top-level click is registered
dom.handle_event("click", Rc::new(PlatformEventData::new(Box::<SerializedMouseData>::default())), ElementId(1), true);
dom.handle_event(
"click",
Rc::new(PlatformEventData::new(Box::<SerializedMouseData>::default())),
ElementId(1),
true,
);
assert_eq!(*CLICKS.lock().unwrap(), 1);
// break reference....
@@ -22,7 +27,12 @@ fn events_propagate() {
}
// Lower click is registered
dom.handle_event("click", Rc::new(PlatformEventData::new(Box::<SerializedMouseData>::default())), ElementId(2), true);
dom.handle_event(
"click",
Rc::new(PlatformEventData::new(Box::<SerializedMouseData>::default())),
ElementId(2),
true,
);
assert_eq!(*CLICKS.lock().unwrap(), 3);
// break reference....
@@ -32,7 +42,12 @@ fn events_propagate() {
}
// Stop propagation occurs
dom.handle_event("click", Rc::new(PlatformEventData::new(Box::<SerializedMouseData>::default())), ElementId(2), true);
dom.handle_event(
"click",
Rc::new(PlatformEventData::new(Box::<SerializedMouseData>::default())),
ElementId(2),
true,
);
assert_eq!(*CLICKS.lock().unwrap(), 3);
}