Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Commit

Permalink
fix(Header): Disable event listener on input fields (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjervis authored Nov 19, 2018
1 parent 1640d89 commit 7d1a11c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/src/components/App/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class Header extends Component {
};

handleDocumentKeydown = event => {
if (event.key === '/' && event.target.id !== SEARCH_BAR_ID) {
const isInputField = /^(INPUT|TEXTAREA)$/i.test(event.target.tagName);
if (event.key === '/' && !isInputField) {
event.preventDefault();
this.handleMenuToggle({ target: { checked: true } });
} else if (event.key === 'Escape') {
Expand Down

0 comments on commit 7d1a11c

Please sign in to comment.