Skip to content

Commit

Permalink
Merge pull request #29 from ajyoon/slash-command-text-inputs
Browse files Browse the repository at this point in the history
Dont capture search shortcut when inputs are focused
  • Loading branch information
aaranxu committed Dec 13, 2021
2 parents bec18d3 + 0c8a9e1 commit e03e8a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ document.addEventListener('keydown', inputFocus);

function inputFocus(e) {

if (e.keyCode === 191 ) {
if (e.keyCode === 191
&& document.activeElement.tagName !== "INPUT"
&& document.activeElement.tagName !== "TEXTAREA") {
e.preventDefault();
userinput.focus();
}
Expand Down

0 comments on commit e03e8a5

Please sign in to comment.