Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .changeset/dirty-rockets-read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/ui': patch
---

Add an accessible name to the API Keys search input so screen readers announce it correctly.
3 changes: 3 additions & 0 deletions packages/ui/src/components/APIKeys/APIKeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ export const APIKeysPage = ({ subject, perPage, revokeModalRoot }: APIKeysPagePr
>
<Box elementDescriptor={descriptors.apiKeysSearchBox}>
<InputWithIcon
name='apiKeysSearch'
placeholder={t(localizationKeys('apiKeys.action__search'))}
aria-label={t(localizationKeys('apiKeys.action__search'))}
Comment thread
maxyinger marked this conversation as resolved.
leftIcon={
<Icon
icon={MagnifyingGlass}
Expand All @@ -171,6 +173,7 @@ export const APIKeysPage = ({ subject, perPage, revokeModalRoot }: APIKeysPagePr
}
value={searchValue}
type='search'
autoComplete='off'
autoCapitalize='none'
spellCheck={false}
onChange={e => setSearchValue(e.target.value)}
Expand Down
12 changes: 12 additions & 0 deletions packages/ui/src/components/APIKeys/__tests__/APIKeys.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,16 @@ describe('APIKeys', () => {
expect(getByText(/No API keys found/i)).toBeVisible();
});
});

it('exposes an accessible label on the search input', async () => {
const { wrapper } = await createFixtures(f => {
f.withUser({ email_addresses: ['test@clerk.com'] });
});

const { getByRole } = render(<APIKeys />, { wrapper });

await waitFor(() => {
expect(getByRole('searchbox', { name: /search keys/i })).toBeVisible();
});
});
});
Loading