Skip to content

Commit

Permalink
adds condition on navigation for route-link
Browse files Browse the repository at this point in the history
  • Loading branch information
hedefalk committed Nov 2, 2018
1 parent 1aaddcc commit 3a2e6f2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/route-link/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ module.exports = class {
}

navigate(ev) {
ev.preventDefault();
if (this.input.href) navigate(this.input.href);
else throw new Error('Missing attribute \'href\' on route-link component');
const comboKey = ev.metaKey || ev.altKey || ev.ctrlKey || ev.shiftKey
if (evt.button === 0 && !comboKey) {
ev.preventDefault();
if (this.input.href) navigate(this.input.href);
else throw new Error('Missing attribute \'href\' on route-link component');
}
}

middleActive(toState, fromState, done) {
Expand Down

0 comments on commit 3a2e6f2

Please sign in to comment.