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

updating aria-controls for combobox to have the value of itself or it… #5088

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/react-select/src/Select.tsx
Expand Up @@ -1558,7 +1558,9 @@ export default class Select<
'aria-autocomplete': 'list' as const,
'aria-expanded': menuIsOpen,
'aria-haspopup': true,
'aria-controls': this.getElementId('listbox'),
'aria-controls': menuIsOpen
? this.getElementId('listbox')
: this.getElementId('input'),
'aria-owns': this.getElementId('listbox'),
'aria-errormessage': this.props['aria-errormessage'],
'aria-invalid': this.props['aria-invalid'],
Expand Down
Expand Up @@ -193,7 +193,7 @@ exports[`defaults - snapshot 1`] = `
>
<input
aria-autocomplete="list"
aria-controls="react-select-2-listbox"
aria-controls="react-select-2-input"
aria-describedby="react-select-2-placeholder"
aria-expanded="false"
aria-haspopup="true"
Expand Down
Expand Up @@ -193,7 +193,7 @@ exports[`defaults - snapshot 1`] = `
>
<input
aria-autocomplete="list"
aria-controls="react-select-2-listbox"
aria-controls="react-select-2-input"
aria-describedby="react-select-2-placeholder"
aria-expanded="false"
aria-haspopup="true"
Expand Down
Expand Up @@ -193,7 +193,7 @@ exports[`defaults - snapshot 1`] = `
>
<input
aria-autocomplete="list"
aria-controls="react-select-2-listbox"
aria-controls="react-select-2-input"
aria-describedby="react-select-2-placeholder"
aria-expanded="false"
aria-haspopup="true"
Expand Down
Expand Up @@ -193,7 +193,7 @@ exports[`snapshot - defaults 1`] = `
>
<input
aria-autocomplete="list"
aria-controls="react-select-2-listbox"
aria-controls="react-select-2-input"
aria-describedby="react-select-2-placeholder"
aria-expanded="false"
aria-haspopup="true"
Expand Down
Expand Up @@ -193,7 +193,7 @@ exports[`defaults > snapshot 1`] = `
>
<input
aria-autocomplete="list"
aria-controls="react-select-2-listbox"
aria-controls="react-select-2-input"
aria-describedby="react-select-2-placeholder"
aria-expanded="false"
aria-haspopup="true"
Expand Down