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

Add aria-label to div wrapper #372

Open
robbiegod opened this issue Sep 16, 2022 · 0 comments
Open

Add aria-label to div wrapper #372

robbiegod opened this issue Sep 16, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@robbiegod
Copy link

robbiegod commented Sep 16, 2022

Is your feature request related to a problem? Please describe.
We use a 508 scanner (SortSite) and the results from the scan are: ARIA control has no label. It refers to the div autoComplete wrapper.

<div class="autoComplete_wrapper" role="combobox" aria-owns="lookup-autoComplete" aria-haspopup="true" aria-expanded="false">

Thoroughly Describe the solution you'd like

1, Add a default aria-label value to the autoComplete_wrapper.
2, Add a value to the config that can be set to customize the value of aria-label if developer wants to customize the message.

Something like:

wrapper: true, wrapperlabel: 'My custom aria label',

OR:

wrapper: {
enabled: true, 
ariaLabel: "My custom aria label."
},

Please provide a few use cases for this feature
Improves accessibility by giving the screen reader something to announce to the user.

Please Describe alternatives you've considered
For the time being, we have added this code to our script, but because it gets added after the autocomplete loads, the SortSite scanner doesn't seem to be able to pick it up.

document.querySelector("#autocompleteInput").addEventListener("init", function (event) {
	var autoCompleteWrapper = document.querySelector(".autoComplete_wrapper");
	if (autoCompleteWrapper) {
		autoCompleteWrapper.setAttribute("aria-label", "Location form autocomplete");
	}
});

I feel its better to have the value the in the config since autoComplete is building that wrapper completely already.

@robbiegod robbiegod added the enhancement New feature or request label Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant