Skip to content
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

Merged
merged 2 commits into from
Mar 14, 2021
Merged

Consistent id's with svelte-search #19

merged 2 commits into from
Mar 14, 2021

Conversation

Skovvart
Copy link
Contributor

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.

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.
Copy link
Owner

@metonym metonym left a 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}
Copy link
Owner

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.

@metonym metonym self-requested a review March 14, 2021 22:19
Copy link
Owner

@metonym metonym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #18

@metonym metonym merged commit ae50e57 into metonym:master Mar 14, 2021
@Skovvart Skovvart deleted the patch-2 branch March 14, 2021 22:52
metonym pushed a commit to metonym/svelte-search that referenced this pull request Mar 15, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants