change prevent default to detect on{event} rather than {event}
@@ -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 {
