MCPcopy Create free account
hub / github.com/anomalyco/models.dev / openSearchModal

Function openSearchModal

packages/web/src/index.ts:412–428  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

410}
411
412function openSearchModal() {
413 if (!searchModal || !searchInput) return;
414 if (helpModal?.open) closeDialog();
415 if (mobileMenu?.open) closeMobileMenu(false);
416
417 lastFocusedElement =
418 document.activeElement instanceof HTMLElement
419 ? document.activeElement
420 : null;
421
422 if (!searchModal.open) searchModal.showModal();
423 renderSearchResults();
424 requestAnimationFrame(() => {
425 searchInput.focus();
426 searchInput.select();
427 });
428}
429
430function closeSearchModal() {
431 if (!searchModal) return;

Callers 1

index.tsFile · 0.85

Calls 3

closeDialogFunction · 0.85
closeMobileMenuFunction · 0.85
renderSearchResultsFunction · 0.85

Tested by

no test coverage detected