Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-10-24 - Search Input Interaction and Accessibility
**Learning:** Reliance on `on:keyup` for search inputs fails to capture events like pasting or drag-and-drop, leading to missed user intent. `on:input` is the comprehensive solution. Additionally, visual loading spinners (like `CircularProgress`) are invisible to screen readers without an explicit `aria-label`.
**Action:** Always prefer `on:input` for text fields and ensure every loading state has a corresponding `aria-label` or `aria-live` region.
12 changes: 8 additions & 4 deletions src/routes/DomainSearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
let domainName: string = '';
let nameSearched: string = '';
let isLoading: boolean = false;
let debounceTimer: NodeJS.Timeout;
let debounceTimer: ReturnType<typeof setTimeout>;

$: errors = invalid ? validator.getErrors() : [];
$: invalid = domainName !== '' && !validator.validate(domainName, { raiseError: false });
Expand Down Expand Up @@ -55,15 +55,15 @@
class="domain-input"
variant="outlined"
bind:value={domainName}
on:keyup={() => debounce()}
on:input={() => debounce()}
bind:invalid
label="Domain name"
withTrailingIcon
autofocus
>
<svelte:fragment slot="trailingIcon">
<div class="submit">
<IconButton aria-label="search">
<IconButton aria-label="search" type="submit">
<Icon icon="search" />
</IconButton>
</div>
Expand All @@ -81,7 +81,11 @@
<div class="card-content">
<span>{nameSearchedLabel}</span>

<CircularProgress style="height: 32px; width: 32px;" indeterminate />
<CircularProgress
style="height: 32px; width: 32px;"
indeterminate
aria-label="Loading domain search results"
/>
</div>
</CardContent>
</Card>
Expand Down