瀏覽代碼

fix(core): do not use capture on _blank link event handler, closes #2791 (#3349)

Lucas Fernandes Nogueira 3 年之前
父節點
當前提交
10e3190fdd
共有 2 個文件被更改,包括 8 次插入4 次删除
  1. 5 0
      .changes/link-stop-propagation.md
  2. 3 4
      core/tauri/scripts/core.js

+ 5 - 0
.changes/link-stop-propagation.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Allow preventing opening the default browser on a click on an `<a target="_blank">` element via `stopImmediatePropagation()`.

+ 3 - 4
core/tauri/scripts/core.js

@@ -112,8 +112,7 @@
           }
           target = target.parentElement
         }
-      },
-      true
+      }
     )
   }
 
@@ -206,8 +205,8 @@
         options:
           typeof options === 'string'
             ? {
-                title: options
-              }
+              title: options
+            }
             : options
       }
     })