-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistent id's with svelte-search #19
Conversation
Pass Typeahead's id property to Search to ensure proper `aria-labelledby` references. Updated Typeahead wrapper div id to not clash with Search's input id (this feels slightly hackish to me, but avoids separate PRs to Search). Removed an unreferenced (and oddly defined?) CSS class, updated an inner aria-labelledby reference (this is honestly a guess, as I'm not exactly an aria expert...) and ensured unique id's on the result list items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for spending the time on a PR.
See my requested changes below. I believe the class name should be handled separately.
@@ -174,15 +175,14 @@ | |||
/> | |||
{#if !hideDropdown && results.length > 0} | |||
<ul | |||
class:svelte-typeahead-list={true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you restore the class name? It's a breaking change that's unrelated to the PR. I'd prefer to first patch the component before bumping a major version for this alone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #18
* Option to remove form aria attributes metonym/svelte-typeahead#19 did not solve the Lighthouse issues, but removing the `role` and `aria-labelledby` from the form does (Typeahead's `[data-svelte-typeahead]` wrapper should hopefully retain all the accessibility properties). If the PR is accepted, Typeahead will need to be updated use this non-default option. * Update type
Pass Typeahead's id property to Search to ensure proper
aria-labelledby
references.Updated Typeahead wrapper div id to not clash with Search's input id (this feels slightly hackish to me, but avoids separate PRs to Search).
Removed an unreferenced (and oddly defined?) CSS class, updated an inner aria-labelledby reference (this is honestly a guess, as I'm not exactly an aria expert...) and ensured unique id's on the result list items.