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

How to add aria-label to noUiHandler #1019

Closed
akinhwan opened this issue Sep 18, 2019 · 8 comments
Closed

How to add aria-label to noUiHandler #1019

akinhwan opened this issue Sep 18, 2019 · 8 comments
Labels
Feature Feature requests/suggestions
Milestone

Comments

@akinhwan
Copy link

akinhwan commented Sep 18, 2019

How can i add an aria-label attribute to this dynamic div?

image

@leongersen
Copy link
Owner

Sorry, what are you asking?

@akinhwan
Copy link
Author

I ended up adding the aria-label attribute via javascript, sorry thanks. in case someone else needs to resolve axe violation for that

@lianatech-toni-heikkala
Copy link

I'm also doing accessibility testing with axe accessibility testing tool and came across this same problem.
Like issue opener's screenshot shows, axe reports following problem: https://dequeuniversity.com/rules/axe/3.3/aria-input-field-name

Basically it would be nice if there was an option to give the slider handle "aria-label" attribute. Currently screen readers read out only the "aria-valuetext" when handle is focused, which by itself might be confusing for some users.

Other options could be giving the handle either "id" or "aria-labelledby" attribute, but these would require always having either label or some other element containing description text. MDN examples

This is not that big a deal though, since like akinhwan said the attribute(s) can be added after slider initialization using some JS. Just thought I'd clarify what is asked here :)

@leongersen
Copy link
Owner

I'm open for suggestions on this feature. It could look something like this:

noUiSlider.create(slider, {
    start: [20, 80],
    handleAttributes: [
        { 'aria-label': 'lower' },
        { 'aria-label': 'upper' },
    ],
    range: {
        'min': 0,
        'max': 100
    }
});

@dippas
Copy link

dippas commented Aug 5, 2021

@leongersen your solution seems good to me, are you thinking implementing this ?

@leongersen leongersen added this to the 15.4.0 milestone Aug 12, 2021
@leongersen
Copy link
Owner

The handleAttributes option is now available in noUiSlider 15.4.0.

Thank you for contributing, everybody!

@jurajk
Copy link

jurajk commented Aug 23, 2021

The handleAttributes option is now available in noUiSlider 15.4.0.

Thank you for contributing, everybody!

Thank you @leongersen, I just wanted to see if i could implement this and possibly open a PR only to find out you already did this. Much appreciated!

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Feature requests/suggestions
Projects
None yet
Development

No branches or pull requests

5 participants