Skip to content

Commit

Permalink
don't trigger transition when control keys or other mouse buttons are…
Browse files Browse the repository at this point in the history
… used. (#758)
  • Loading branch information
LinusBorg authored and yyx990803 committed Oct 13, 2016
1 parent 541a543 commit 2dde5bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2dde5bb

Please sign in to comment.