Skip to content

Commit 8231de0

Browse files
authored
Exclude input and textarea from "/" key handler (#1213)
1 parent ac859d5 commit 8231de0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

js/search.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,13 @@ const initSearchModal = () => {
294294

295295
// Open when / is pressed
296296
document.addEventListener("keydown", (event) => {
297-
if (event.target.contentEditable === "true") {
297+
const target = event.target;
298+
299+
if (
300+
target.contentEditable === "true" ||
301+
target.tagName === "INPUT" ||
302+
target.tagName === "TEXTAREA"
303+
) {
298304
return;
299305
}
300306

0 commit comments

Comments
 (0)