From 2dde5bbaeb20dd8d1d7c8ca05d8b9ae5913967cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Thu, 13 Oct 2016 06:31:54 +0200 Subject: [PATCH] don't trigger transition when control keys or other mouse buttons are used. (#758) --- src/components/link.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/link.js b/src/components/link.js index 1b312f17c..63c179fbd 100644 --- a/src/components/link.js +++ b/src/components/link.js @@ -40,6 +40,15 @@ export default { const on = { click: (e) => { + // don't redirect with control keys + /* istanbul ignore if */ + if (e.metaKey || e.ctrlKey || e.shiftKey) return + // don't redirect when preventDefault called + /* istanbul ignore if */ + if (e.defaultPrevented) return + // don't redirect on right click + /* istanbul ignore if */ + if (e.button !== 0) return e.preventDefault() if (this.replace) { router.replace(to)