From 3e246b1dfd9ce61fc4acb17fa256bc86d810820b Mon Sep 17 00:00:00 2001 From: Alexander Vakhitov Date: Tue, 29 Nov 2016 11:02:04 +0500 Subject: [PATCH] fix(Link): Fix event.which event.which === undefined, need to check event.nativeEvent.which --- .gitignore | 4 +++- src/components/Link.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e6af348..4852fcb 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,6 @@ jspm_packages .npmrc dist -umd \ No newline at end of file +umd + +.idea \ No newline at end of file diff --git a/src/components/Link.js b/src/components/Link.js index 7ee4bb1..4c74e5b 100644 --- a/src/components/Link.js +++ b/src/components/Link.js @@ -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); }