From 27e98e6fc3407c50c8d10666c78c0923e3d83e5d Mon Sep 17 00:00:00 2001 From: Skyler Date: Tue, 18 Oct 2016 13:54:18 -0700 Subject: [PATCH] Ignore modifier+click and middle click in m.route.link Currently, middle clicking and ctrl+click change the route in the current tab. Expected behavior is to open a new tab/window. --- router/router.js | 1 + 1 file changed, 1 insertion(+) diff --git a/router/router.js b/router/router.js index 7c6aaadc..51f62984 100644 --- a/router/router.js +++ b/router/router.js @@ -112,6 +112,7 @@ module.exports = function($window) { function link(vnode) { vnode.dom.setAttribute("href", prefix + vnode.attrs.href) vnode.dom.onclick = function(e) { + if (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return e.preventDefault() e.redraw = false var href = this.getAttribute("href")