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

feat: add a11y props for search and combobox components #2105

Merged
merged 3 commits into from
May 6, 2024

Conversation

shaharzil
Copy link
Contributor

@shaharzil shaharzil requested a review from a team as a code owner May 5, 2024 17:34
Copy link
Contributor

@YossiSaadi YossiSaadi left a comment

Choose a reason for hiding this comment

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

Just ignore all my comments, and focus on this summary, or just use them as reference.

I think our result should look like this:

<dialog and its props>
	<div role="combobox" aria-expanded="false/true (if the dialog is opened)" aria-haspopup="listbox" aria-owns="options-container" aria-label="My awesome combobox that should do this and that"> // this should be the dialog content container
	  <div id="search-wrapper"> // we have a wrapper for the search input, it shouldn't get any a11y prop I believe
// from mdn: The aria-autocomplete attribute indicates whether inputting text could trigger display of one or more predictions of the user's intended value for a combobox and specifies how predictions will be presented if they are made.
	    <input type="text" role="searchbox" aria-controls="combobox-items-container" aria-autocomplete="list">
	  </div>
	  <div role="listbox" id="combobox-items-container">
	    <div role="option" aria-selected="false">Option 1</div>
	    <div role="option" aria-selected="true">Option 2</div>
	  </div>
	</div>
</dialog>

Wanna discuss it?

Copy link
Contributor

@YossiSaadi YossiSaadi left a comment

Choose a reason for hiding this comment

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

after discussing everything, I understood aria-controls changed all the hierarchy so everything makes sense
Amazing!!

@shaharzil shaharzil merged commit b564e1b into master May 6, 2024
10 checks passed
@shaharzil shaharzil deleted the fix-combobox-a11y branch May 6, 2024 09:13
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