Explorar o código

feat: enable prevent_default everywhere

Jonathan Kelley %!s(int64=3) %!d(string=hai) anos
pai
achega
9dff700c22
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      packages/html/src/global_attributes.rs

+ 4 - 0
packages/html/src/global_attributes.rs

@@ -49,6 +49,10 @@ macro_rules! aria_trait_methods {
 }
 
 pub trait GlobalAttributes {
+    fn prevent_default<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
+        cx.attr("dioxus-prevent-default", val, None, false)
+    }
+
     no_namespace_trait_methods! {
         accesskey;