mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
Fix: disable the search keyboard shortcut in a form (#2041)
This commit is contained in:
@@ -25,7 +25,14 @@ modal.addEventListener("click", function (event) {
|
||||
document.addEventListener("keydown", function (event) {
|
||||
// Forward slash to open search wrapper
|
||||
if (event.key == "/") {
|
||||
if (!searchVisible) {
|
||||
const active = document.activeElement
|
||||
const tag = active.tagName
|
||||
const isInputField =
|
||||
tag === "INPUT" ||
|
||||
tag === "TEXTAREA" ||
|
||||
active.isContentEditable
|
||||
|
||||
if (!searchVisible && !isInputField) {
|
||||
event.preventDefault();
|
||||
displaySearch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user