Merge pull request #422 from rMazeiks/fix-web-missing-event-types

Fix web missing event types
This commit is contained in:
Jon Kelley authored and GitHub committed 2022-06-10 11:44:38 -04:00
commit ea4eb218ab
1 file changed
+9 -6
+9 -6
View File
@@ -178,7 +178,7 @@ fn virtual_event_from_websys_event(
}) })
} }
"keydown" | "keypress" | "keyup" => Arc::new(KeyboardData::from(event)), "keydown" | "keypress" | "keyup" => Arc::new(KeyboardData::from(event)),
"focus" | "blur" => Arc::new(FocusData {}), "focus" | "blur" | "focusout" | "focusin" => Arc::new(FocusData {}),
// todo: these handlers might get really slow if the input box gets large and allocation pressure is heavy // todo: these handlers might get really slow if the input box gets large and allocation pressure is heavy
// don't have a good solution with the serialized event problem // don't have a good solution with the serialized event problem
@@ -258,9 +258,9 @@ fn virtual_event_from_websys_event(
Arc::new(FormData { value, values }) Arc::new(FormData { value, values })
} }
"click" | "contextmenu" | "doubleclick" | "drag" | "dragend" | "dragenter" | "dragexit" "click" | "contextmenu" | "dblclick" | "doubleclick" | "drag" | "dragend" | "dragenter"
| "dragleave" | "dragover" | "dragstart" | "drop" | "mousedown" | "mouseenter" | "dragexit" | "dragleave" | "dragover" | "dragstart" | "drop" | "mousedown"
| "mouseleave" | "mousemove" | "mouseout" | "mouseover" | "mouseup" => { | "mouseenter" | "mouseleave" | "mousemove" | "mouseout" | "mouseover" | "mouseup" => {
Arc::new(MouseData::from(event)) Arc::new(MouseData::from(event))
} }
"pointerdown" | "pointermove" | "pointerup" | "pointercancel" | "gotpointercapture" "pointerdown" | "pointermove" | "pointerup" | "pointercancel" | "gotpointercapture"
@@ -305,6 +305,8 @@ fn event_name_from_typ(typ: &str) -> &'static str {
"keypress" => "keypress", "keypress" => "keypress",
"keyup" => "keyup", "keyup" => "keyup",
"focus" => "focus", "focus" => "focus",
"focusout" => "focusout",
"focusin" => "focusin",
"blur" => "blur", "blur" => "blur",
"change" => "change", "change" => "change",
"input" => "input", "input" => "input",
@@ -314,6 +316,7 @@ fn event_name_from_typ(typ: &str) -> &'static str {
"click" => "click", "click" => "click",
"contextmenu" => "contextmenu", "contextmenu" => "contextmenu",
"doubleclick" => "doubleclick", "doubleclick" => "doubleclick",
"dblclick" => "dblclick",
"drag" => "drag", "drag" => "drag",
"dragend" => "dragend", "dragend" => "dragend",
"dragenter" => "dragenter", "dragenter" => "dragenter",
@@ -374,8 +377,8 @@ fn event_name_from_typ(typ: &str) -> &'static str {
"volumechange" => "volumechange", "volumechange" => "volumechange",
"waiting" => "waiting", "waiting" => "waiting",
"toggle" => "toggle", "toggle" => "toggle",
_ => { a => {
panic!("unsupported event type") panic!("unsupported event type {:?}", a);
} }
} }
} }