We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7cc85e7 commit 506b1a2Copy full SHA for 506b1a2
lib/Link.js
@@ -26,10 +26,12 @@ var Link = React.createClass({
26
if (this.props.onClick) {
27
this.props.onClick(e);
28
}
29
- if (!e.defaultPrevented &&
30
- // Don't break middle-click or (meta|ctrl)+click (new tab)
31
- !(e.button == 1 || e.metaKey || e.ctrlKey)
32
- ) {
+
+ // return if the user did a middle-click, right-click, or used a modifier
+ // key (like ctrl-click, meta-click, shift-click, etc.)
+ if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
33
34
+ if (!e.defaultPrevented) {
35
e.preventDefault();
36
this._navigate(this.props.href, function(err) {
37
if (err) {
0 commit comments