Skip to content

Commit

Permalink
Merge pull request #30 from nfcampos/patch-1
Browse files Browse the repository at this point in the history
do not trigger shortcuts if an input-like element is focused
  • Loading branch information
gaearon committed Feb 19, 2016
2 parents 5aa8b08 + a9ddeb5 commit bb7aa0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DockMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export default class DockMonitor extends Component {
const visibilityKey = parseKey(this.props.toggleVisibilityKey);
const positionKey = parseKey(this.props.changePositionKey);

// do not trigger action if an input-like element is focused
if (e.target.tagName == 'INPUT' || e.target.tagName == 'SELECT' ||
e.target.tagName == 'TEXTAREA' || e.target.isContentEditable) {
return
}

if (this.matchesKey(visibilityKey, e)) {
e.preventDefault();
this.props.dispatch(toggleVisibility());
Expand Down

0 comments on commit bb7aa0e

Please sign in to comment.