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

Guidelines: WCAG 2.0 (Level AA) not followed for ngb date-picker #2543

Closed
kedar9444 opened this issue Jul 23, 2018 · 13 comments
Closed

Guidelines: WCAG 2.0 (Level AA) not followed for ngb date-picker #2543

kedar9444 opened this issue Jul 23, 2018 · 13 comments

Comments

@kedar9444
Copy link

kedar9444 commented Jul 23, 2018

Bug description: The auto generated select fields for month and year violates the WCAG 2.0 (Level AA) guidelines.

Error code : Check 91: select element missing an associated label.
Repair: Add a label element that surrounds the control's label. Set the for attribute on the label element to the same value as the id attribute of the control. And/or add a title attribute to the input element. And/or create a label element that contains the input element.

since the html is auto-generated we can not add the label for it.

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: "^5.1.3"

ng-bootstrap: "1.1.0"

Bootstrap: "4.0.0"

@kedar9444
Copy link
Author

website used for checking : https://achecker.ca/

you can use the html from this link to reproduce the error :
https://ng-bootstrap.github.io/#/components/datepicker/overview

@maxokorokov
Copy link
Member

An option would be to add a title something like:

<select title="months"></select>
<select title="years"></select>

But these strings should be added to i18n in this case

@kedar9444
Copy link
Author

@maxokorokov : But these strings should be added to i18n in this case?
i am not clear about this step can you please elaborate it further.

@kedar9444
Copy link
Author

This is what my code looks like:

image

Add this is how it appears :
image

and here is dynamically generated DOM elements for date-picker, which are clearly missing labels for select boxes used for month and year selection :

image

which violates the WCAG 2.0 guild lines which states : Check 91: select element missing an associated label

@kedar9444 kedar9444 reopened this Jul 23, 2018
@maxokorokov
Copy link
Member

@kedar9444, sure, I see the problem, it was clear from the description. Adding the title attribute should fix it.

But these strings should be added to i18n in this case

Just wanted to say that if we put a hardcoded string as a select box title, we should not forget to translate it.

@kedar9444
Copy link
Author

@maxokorokov : yes, got it.
do you guys have any plan to add/implement these WCAG guidelines for ng-bootstrap?

@pkozlowski-opensource
Copy link
Member

@maxokorokov title="..." would add a "tooltip" to a <select> element, right?
Maybe it is enough to add aria-label="..." if we don't want to have this "tooltip" visually / functionally speaking?

@pkozlowski-opensource pkozlowski-opensource added this to the 3.0.1 milestone Jul 27, 2018
@pkozlowski-opensource pkozlowski-opensource removed this from the 3.0.1 milestone Aug 13, 2018
@Kumar-Aakash
Copy link

Kumar-Aakash commented Aug 13, 2018

@pkozlowski-opensource how we plan to add area-label or title to dynamically generated 'SELECT' element. Because we can't do it from HTML as we can only add ngb-datepicker and available inputs to pass.
Are you planning it for upcoming releases or next versions?

@maxokorokov
Copy link
Member

website used for checking : https://achecker.ca/

By the way, adding aria-label still reported an error for me with the website in question

@Kumar-Aakash
Copy link

@maxokorokov how did you add area-label, can you share HTML snippet ?

@kedar9444
Copy link
Author

@maxokorokov : adding title along with aria-label solves the problem for achecker.ca

@pkozlowski-opensource
Copy link
Member

Fixed through #2636, will be part of a next release.

@kedar9444
Copy link
Author

thanks a lot folks. ❤️❤️❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants