Skip to content

Commit

Permalink
fix(Link): Fix event.which
Browse files Browse the repository at this point in the history
event.which === undefined, need to check event.nativeEvent.which
  • Loading branch information
Alexander Vakhitov authored and ya-woodcutter committed Nov 29, 2016
1 parent 2a718bd commit 3e246b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ jspm_packages

.npmrc
dist
umd
umd

.idea
2 changes: 1 addition & 1 deletion src/components/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Link extends BaseRouterComponent {
initiateLocationChange(e) {
const { target } = this.props;

if (!target && !this.href.protocol && e.which !== 2 && !e.metaKey && !e.ctrlKey) {
if (!target && !this.href.protocol && (e.nativeEvent && e.nativeEvent.which) !== 2 && !e.metaKey && !e.ctrlKey) {
e.preventDefault();
this.locationChange(this.href);
}
Expand Down

0 comments on commit 3e246b1

Please sign in to comment.