Ver Fonte

fix: also prevent default on buttons

Jonathan Kelley há 3 anos atrás
pai
commit
4818c44c7c
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      packages/interpreter/src/interpreter.js

+ 5 - 0
packages/interpreter/src/interpreter.js

@@ -217,6 +217,11 @@ export class Interpreter {
                   }
                 }
               }
+
+              // also prevent buttons from submitting
+              if (target.tagName == "BUTTON") {
+                event.preventDefault();
+              }
             }
             // walk the tree to find the real element
             while (realId == null) {