MCPcopy Index your code
hub / github.com/jackvale/rectg / clearSearch

Function clearSearch

web/src/scripts/main.js:487–494  ·  view source on GitHub ↗
({ focus = true } = {})

Source from the content-addressed store, hash-verified

485
486function initSearch() {
487 function clearSearch({ focus = true } = {}) {
488 if (!searchInput) return;
489 searchInput.value = '';
490 renderSection(currentSectionId, { updateUrl: true, clearSearch: false, scroll: false });
491 clearSearchBtn?.classList.remove('visible');
492 setResultStatus('', false);
493 if (focus) searchInput.focus();
494 }
495
496 searchInput?.addEventListener('input', (event) => {
497 renderSearch(event.target.value || '', { updateUrl: true });

Callers 1

initSearchFunction · 0.85

Calls 2

renderSectionFunction · 0.85
setResultStatusFunction · 0.85

Tested by

no test coverage detected