domains.ts
typescript
sha256:0997d6250ae6476362f6fe2025af7789f46d03df3e9f34356d5e8ee79b201923
fix(issues): use issue number as pagination cursor, not cre…
Sonnet 4.6
patch
8 days ago
| 1 | /** |
| 2 | * domains.ts — Domains listing page behaviour. |
| 3 | * |
| 4 | * Wires the global navbar search bar to the hero search input so that |
| 5 | * clicking / focusing the navbar field redirects focus to the hero input, |
| 6 | * exactly as the explore page does with its own hero search. |
| 7 | */ |
| 8 | |
| 9 | export function initDomains(): void { |
| 10 | wireNavbarSearch(); |
| 11 | } |
| 12 | |
| 13 | // ── Wire navbar search → hero search on domains page ───────────────────────── |
| 14 | |
| 15 | function wireNavbarSearch(): void { |
| 16 | const navForm = document.querySelector<HTMLFormElement>('.navbar-search-form'); |
| 17 | const navInput = document.querySelector<HTMLInputElement>('.navbar-search-input'); |
| 18 | const heroInput = document.getElementById('domain-search-input') as HTMLInputElement | null; |
| 19 | |
| 20 | if (!navForm || !navInput || !heroInput) return; |
| 21 | |
| 22 | // Intercept navbar form submit: push value into hero input and trigger HTMX |
| 23 | navForm.addEventListener('submit', (e) => { |
| 24 | e.preventDefault(); |
| 25 | const q = navInput.value.trim(); |
| 26 | if (q) heroInput.value = q; |
| 27 | heroInput.focus(); |
| 28 | heroInput.dispatchEvent(new Event('input', { bubbles: true })); |
| 29 | navInput.value = ''; |
| 30 | }); |
| 31 | |
| 32 | // Redirect focus from navbar input straight to the hero input |
| 33 | navInput.addEventListener('focus', () => { |
| 34 | heroInput.focus(); |
| 35 | navInput.blur(); |
| 36 | }); |
| 37 | } |
File History
1 commit
sha256:0997d6250ae6476362f6fe2025af7789f46d03df3e9f34356d5e8ee79b201923
fix(issues): use issue number as pagination cursor, not cre…
Sonnet 4.6
patch
8 days ago