Bläddra i källkod

change prevent default to detect on{event} rather than {event}

Evan Almloff 3 år sedan
förälder
incheckning
53d5ea2f42
1 ändrade filer med 14 tillägg och 14 borttagningar
  1. 14 14
      packages/tui/src/node.rs

+ 14 - 14
packages/tui/src/node.rs

@@ -69,20 +69,20 @@ impl NodeDepState for PreventDefault {
             .find(|a| a.name == "dioxus-prevent-default")
             .map(|a| a.value)
         {
-            Some("focus") => PreventDefault::Focus,
-            Some("keypress") => PreventDefault::KeyPress,
-            Some("keyrelease") => PreventDefault::KeyRelease,
-            Some("keydown") => PreventDefault::KeyDown,
-            Some("keyup") => PreventDefault::KeyUp,
-            Some("click") => PreventDefault::Click,
-            Some("mousedown") => PreventDefault::MouseDown,
-            Some("mouseup") => PreventDefault::MouseUp,
-            Some("mouseenter") => PreventDefault::MouseEnter,
-            Some("mouseover") => PreventDefault::MouseOver,
-            Some("mouseleave") => PreventDefault::MouseLeave,
-            Some("mouseout") => PreventDefault::MouseOut,
-            Some("wheel") => PreventDefault::Wheel,
-            Some("contextmenu") => PreventDefault::ContextMenu,
+            Some("onfocus") => PreventDefault::Focus,
+            Some("onkeypress") => PreventDefault::KeyPress,
+            Some("onkeyrelease") => PreventDefault::KeyRelease,
+            Some("onkeydown") => PreventDefault::KeyDown,
+            Some("onkeyup") => PreventDefault::KeyUp,
+            Some("onclick") => PreventDefault::Click,
+            Some("onmousedown") => PreventDefault::MouseDown,
+            Some("onmouseup") => PreventDefault::MouseUp,
+            Some("onmouseenter") => PreventDefault::MouseEnter,
+            Some("onmouseover") => PreventDefault::MouseOver,
+            Some("onmouseleave") => PreventDefault::MouseLeave,
+            Some("onmouseout") => PreventDefault::MouseOut,
+            Some("onwheel") => PreventDefault::Wheel,
+            Some("oncontextmenu") => PreventDefault::ContextMenu,
             _ => return false,
         };
         if new == *self {