commit 2f0abe63d4d630583e2163779bd26aaad13e18ea (tree)
parent df8cfb1273e7b99ff5de0164c676d291191a72c6
Author: r00ster91 <r00ster91@proton.me>
Date: Sat, 6 Aug 2022 15:16:27 +0200
fix: disable search bar before loading
This fixes the new search placeholder not disappearing if you type before
it finished loading, and maybe some other things.
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/docs/index.html b/lib/docs/index.html
@@ -616,7 +616,7 @@
<section class="docs">
<div style="position: relative">
<span id="searchPlaceholder"><kbd>S</kbd> to search, <kbd>?</kbd> for more options</span>
- <input type="search" class="search" id="search" autocomplete="off" spellcheck="false">
+ <input type="search" class="search" id="search" autocomplete="off" spellcheck="false" disabled>
</div>
<p id="status">Loading...</p>
<div id="sectNav" class="hidden"><ul id="listNav"></ul></div>
diff --git a/lib/docs/main.js b/lib/docs/main.js
@@ -51,6 +51,8 @@ var zigAnalysis;
let domHelpModal = document.getElementById("helpModal");
const domSearchPlaceholder = document.getElementById("searchPlaceholder");
+ domSearch.disabled = false;
+
let searchTimer = null;
let escapeHtmlReplacements = {