Skip to content

Commit

Permalink
Exclude input and textarea from "/" key handler (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records authored Jan 28, 2025
1 parent ac859d5 commit 8231de0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ const initSearchModal = () => {

// Open when / is pressed
document.addEventListener("keydown", (event) => {
if (event.target.contentEditable === "true") {
const target = event.target;

if (
target.contentEditable === "true" ||
target.tagName === "INPUT" ||
target.tagName === "TEXTAREA"
) {
return;
}

Expand Down

0 comments on commit 8231de0

Please sign in to comment.