mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
autodoc: Start search on any search input event, not just keydown
This commit is contained in:
parent
4652729217
commit
bebb6a45a5
@ -133,6 +133,7 @@ const NAV_MODES = {
|
||||
|
||||
domSearch.disabled = false;
|
||||
domSearch.addEventListener("keydown", onSearchKeyDown, false);
|
||||
domSearch.addEventListener("input", onSearchInput, false);
|
||||
domSearch.addEventListener("focus", ev => {
|
||||
domSearchPlaceholder.classList.add("hidden");
|
||||
canToggleHelpModal = false;
|
||||
@ -4009,15 +4010,17 @@ function addDeclToSearchResults(decl, declIndex, modNames, item, list, stack) {
|
||||
ev.stopPropagation();
|
||||
return;
|
||||
default:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
|
||||
curSearchIndex = -1;
|
||||
// Search is triggered via an `input` event handler, not on arbitrary `keydown` events.
|
||||
ev.stopPropagation();
|
||||
startAsyncSearch();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function onSearchInput(ev) {
|
||||
curSearchIndex = -1;
|
||||
startAsyncSearch();
|
||||
}
|
||||
|
||||
function moveSearchCursor(dir) {
|
||||
if (
|
||||
curSearchIndex < 0 ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user