Skip to content

Commit

Permalink
refactor: check target and bail if not body
Browse files Browse the repository at this point in the history
  • Loading branch information
third774 committed Oct 12, 2018
1 parent 8f31e7d commit 1fba7f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions v1/lib/core/Site.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class Site extends React.Component {
dangerouslySetInnerHTML={{
__html: `
document.addEventListener('keyup', function(e) {
if (e.target !== document.body) {
return;
}
// keyCode for '/' (slash)
if (e.keyCode === 191) {
const search = document.getElementById('search_input_react');
Expand Down

0 comments on commit 1fba7f0

Please sign in to comment.