Accessibility improvements#17323
Conversation
|
LGTM from a code point of view (I did not test "visually"), but current e2e tests are failing. |
bd15233 to
8db2965
Compare
|
Not sure why there are color contrast failures. The errors are not present when run locally and the screenshot from the CI failure looks OK too. |
3f1b04c to
70ecf6c
Compare
|
Seems to have been issues with animations. Locally, I have animations disabled in my OS settings (browser therefore sets prefers-reduced-motion) because I hate useless animations. In the CI, all animations would be used and it seems that the color contrast check is being done in the middle of an animation/transition (like a fade in). I added an option to allow disabling animations. Most people that have vision issues will also have non-essential animations disabled, so it shouldn't be a big deal to disable them when needed in accessibility checks. |
AdrienClairembault
left a comment
There was a problem hiding this comment.
Almost all the selectors in the new e2e tests of this PR seems extremely brittle as they are css classes based.
This kind of selectors break easily and will make maintaining the tests much harder in the long run.
IMO we need to use findByRole selectors in 99% of the cases, with a fallback to less ideal selectors like ids when there is no other possibilities (and css classes as the very last resort).
The findByRole selectors also indirectly improve accessibility, which would be ideal given the title of this PR ;)
IMHO, we should distinct 2 cases here:
The |
For container your have |
Maybe using I do not know if it is a valid option, but anyways, having tests based on CSS selectors in indeed not the best option. @cconard96 What is your opinion on this? |
|
cedric-anne
left a comment
There was a problem hiding this comment.
I guess the selectors used in tests could be improved, but having accessibility tests is still a good point and I guess we could merge this PR and improve the selectors later, if tests fails due to a DOM structure/content refactoring.
@cconard96 Could you please rebase this PR to fix conflicts ?
53b31e5 to
b3fe70d
Compare
b3fe70d to
5801d38
Compare
Fixed:
glpi_html_dialogwere missing a labelglpi_html_dialogdid not capture focus (could not tab through the inputs in the dialog without first clicking inside it)glpi_html_dialoghad the wrong header level for the titleNew discovered issues that haven't been addressed yet:
altInputis true because they make the original input hidden and create a new one. The label becomes associated with the hidden input rather than the visible one.accesskey/shortcut by defaultPossible solution notes: