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

+88
View File
@@ -1324,3 +1324,91 @@ pub(crate) fn _event_meta(event: &UserEvent) -> (bool, EventPriority) {
_ => (true, Low),
}
}
pub fn event_bubbles(evt: &str) -> bool {
match evt {
"copy" => true,
"cut" => true,
"paste" => true,
"compositionend" => true,
"compositionstart" => true,
"compositionupdate" => true,
"keydown" => true,
"keypress" => true,
"keyup" => true,
"focus" => false,
"focusout" => true,
"focusin" => true,
"blur" => false,
"change" => true,
"input" => true,
"invalid" => true,
"reset" => true,
"submit" => true,
"click" => true,
"contextmenu" => true,
"doubleclick" => true,
"dblclick" => true,
"drag" => true,
"dragend" => true,
"dragenter" => false,
"dragexit" => false,
"dragleave" => true,
"dragover" => true,
"dragstart" => true,
"drop" => true,
"mousedown" => true,
"mouseenter" => false,
"mouseleave" => false,
"mousemove" => true,
"mouseout" => true,
"scroll" => false,
"mouseover" => true,
"mouseup" => true,
"pointerdown" => true,
"pointermove" => true,
"pointerup" => true,
"pointercancel" => true,
"gotpointercapture" => true,
"lostpointercapture" => true,
"pointerenter" => false,
"pointerleave" => false,
"pointerover" => true,
"pointerout" => true,
"select" => true,
"touchcancel" => true,
"touchend" => true,
"touchmove" => true,
"touchstart" => true,
"wheel" => true,
"abort" => false,
"canplay" => true,
"canplaythrough" => true,
"durationchange" => true,
"emptied" => true,
"encrypted" => true,
"ended" => true,
"error" => false,
"loadeddata" => true,
"loadedmetadata" => true,
"loadstart" => false,
"pause" => true,
"play" => true,
"playing" => true,
"progress" => false,
"ratechange" => true,
"seeked" => true,
"seeking" => true,
"stalled" => true,
"suspend" => true,
"timeupdate" => true,
"volumechange" => true,
"waiting" => true,
"animationstart" => true,
"animationend" => true,
"animationiteration" => true,
"transitionend" => true,
"toggle" => true,
_ => panic!("unsupported event type {:?}", evt),
}
}