Browse Source

feat: enable prevent_default everywhere

Jonathan Kelley 3 years ago
parent
commit
9dff700
1 changed files with 4 additions and 0 deletions
  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;