handle bubbling events

This commit is contained in:
Evan Almloff committed 2022-06-22 13:57:05 -05:00
1 parent d9e14db434
commit 61b4bb2f19
9 files changed
+363 -27

No files matched your search

+3
View File
@@ -63,6 +63,9 @@ pub struct UserEvent {
/// The event type IE "onclick" or "onmouseover"
pub name: &'static str,
/// If the event is bubbles up through the vdom
pub bubbles: bool,
/// The event data to be passed onto the event handler
pub data: Arc<dyn Any + Send + Sync>,
}
+5 -1
View File
@@ -335,7 +335,7 @@ impl ScopeArena {
log::trace!("calling listener {:?}", listener.event);
if state.canceled.get() {
// stop bubbling if canceled
break;
return;
}
let mut cb = listener.callback.borrow_mut();
@@ -349,6 +349,10 @@ impl ScopeArena {
data: event.data.clone(),
});
}
if !event.bubbles {
return;
}
}
}