Skip to content

Commit 3a8f91c

Browse files
committed
Remove clear buttons
1 parent b38b0ab commit 3a8f91c

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

src/_includes/layout.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ export default (
233233
autocapitalize="none"
234234
spellcheck="false"
235235
/>
236-
<button type="button" class="reference-filter-clear" aria-label="Clear filter" hidden>
237-
<svg viewBox="0 0 16 16" aria-hidden="true">
238-
<path d="m4 4 8 8m0-8-8 8" />
239-
</svg>
240-
</button>
241236
</div>
242237
</div>
243238
<p class="reference-filter-empty" data-reference-filter-empty hidden data-pagefind-ignore="all"></p>

src/static/script.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ initCodeGroups();
6161
function initReferenceFilter() {
6262
const filter = document.querySelector("[data-reference-filter]");
6363
const input = filter?.querySelector(".reference-filter-input");
64-
const clearButton = filter?.querySelector(".reference-filter-clear");
6564
const content = filter?.closest(".content");
6665
const empty = content?.querySelector("[data-reference-filter-empty]");
6766
const kind = filter?.dataset.referenceFilter;
6867

6968
if (
7069
!(input instanceof HTMLInputElement) ||
71-
!(clearButton instanceof HTMLButtonElement) ||
7270
!(empty instanceof HTMLElement) ||
7371
!content ||
7472
(kind !== "methods" && kind !== "types")
@@ -130,7 +128,6 @@ function initReferenceFilter() {
130128
if (group.heading) group.heading.hidden = !groupVisible;
131129
}
132130

133-
clearButton.hidden = rawQuery.length === 0;
134131
empty.hidden = matches > 0;
135132
empty.textContent = matches ? "" : `No ${kind} match “${rawQuery}”.`;
136133
if (toc) toc.hidden = terms.length > 0;
@@ -149,12 +146,6 @@ function initReferenceFilter() {
149146
input.value = "";
150147
update();
151148
});
152-
clearButton.addEventListener("click", () => {
153-
input.value = "";
154-
update();
155-
input.focus({ preventScroll: true });
156-
});
157-
158149
update();
159150
}
160151

0 commit comments

Comments
 (0)