From 270a604d0910361ee5087ac18c700b898bc74196 Mon Sep 17 00:00:00 2001 From: rszyma <44318430+rszyma@users.noreply.github.com> Date: Tue, 30 May 2023 16:32:10 +0200 Subject: [PATCH] cheat-sheet: don't show nfc icons on empty search --- cheat-sheet.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cheat-sheet.js b/cheat-sheet.js index ce450b4f4..39c53240c 100644 --- a/cheat-sheet.js +++ b/cheat-sheet.js @@ -124,16 +124,19 @@ document.addEventListener('DOMContentLoaded', function () { function searchGlyphs() { let searchTerm = elementGlyphSearch.value; + let prefixSearchEnabled = true + if (searchTerm === "") { // MiniSearch don't allow empty searches, so we search for "nf". searchTerm = "nf"; + prefixSearchEnabled = false; } // TODO: search suggestions remainingSearchResults = miniSearch.search(searchTerm, { - prefix: true, + prefix: prefixSearchEnabled, combineWith: "AND", boost: {id: 0.001}, boostDocument: ((documentId, term, storedFields) => {