소스 검색

feat: enable prevent_default everywhere

Jonathan Kelley 3 년 전
부모
커밋
9dff700c22
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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;