mirror of
https://github.com/status-im/react-navigation.git
synced 2025-02-24 17:18:09 +00:00
Don’t handle click with modifier keys. (#10)
This commit is contained in:
parent
ede9dc766c
commit
7441ecad05
@ -1,5 +1,8 @@
|
||||
import React, { PropTypes, Component } from 'react';
|
||||
|
||||
const isModifiedEvent = (event) =>
|
||||
!!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
||||
|
||||
const Linkable = (Inner) => {
|
||||
class LinkableWrapped extends Component {
|
||||
render() {
|
||||
@ -29,7 +32,7 @@ const Linkable = (Inner) => {
|
||||
}
|
||||
onClick = e => {
|
||||
const action = this.getAction();
|
||||
if (action) {
|
||||
if (!isModifiedEvent(e) && action) {
|
||||
this.context.dispatch(action);
|
||||
e.preventDefault();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user