From 27af269ad0a26e858217b71ba5d4697bdb791ae8 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Wed, 2 Apr 2025 14:24:40 +0800 Subject: feat: double-click to turn off global search also clearer comment --- layouts/partials/components/global-search.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layouts/partials/components/global-search.html b/layouts/partials/components/global-search.html index 9311416d..5b158abe 100644 --- a/layouts/partials/components/global-search.html +++ b/layouts/partials/components/global-search.html @@ -106,9 +106,15 @@ } }); + // trigger by clicking instruction text + // to allow mobile users to search const searchInstruction = document.getElementById("search-instruction"); if (searchInstruction) { searchInstruction.addEventListener("click", turnOn); } + + // double-click to turn off search + // in case esc and ctrl/cmd+k cannot be used + search.addEventListener("dblclick", turnOff); })(); -- cgit v1.2.3