From 1cc2332f7b09596b36007f5fc0c2fe23d21305d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=91?= <1395348685z@gmail.com> Date: Mon, 9 Aug 2021 14:01:33 +0800 Subject: [PATCH] Support target attr of links in default trigger --- src/utils/DefaultTrigger.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/DefaultTrigger.ts b/src/utils/DefaultTrigger.ts index 5aaf1c4..3c2749d 100644 --- a/src/utils/DefaultTrigger.ts +++ b/src/utils/DefaultTrigger.ts @@ -42,8 +42,10 @@ export default class DefaultTrigger { if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return; } + if (!matchesDefault(link.target, '_self')) return; + // External. - // loadURL checks external but without browsers' attribute related support. + // loadURL checks external while having no browsers' attribute related support. if (link.origin !== window.location.origin) return; event.preventDefault();