Chrome Accessibility Tools plains that certain children of an overlay box do not have the right contrast ratio. It seems like the tool considers the children to be "visible" when the overlay is hidden.
I can see the aria-hidden
property of the overlay being correctly set in the inspector as I open/close it, though (using attr("aria-hidden","false");
).
Setting aria-hidden="true";
through the inspector on the children individually fixes this problem.
I am confused as aria-hidden is supposed to hide the element and its children. Does anyone know what I am doing wrong?
Chrome Accessibility Tools plains that certain children of an overlay box do not have the right contrast ratio. It seems like the tool considers the children to be "visible" when the overlay is hidden.
I can see the aria-hidden
property of the overlay being correctly set in the inspector as I open/close it, though (using attr("aria-hidden","false");
).
Setting aria-hidden="true";
through the inspector on the children individually fixes this problem.
I am confused as aria-hidden is supposed to hide the element and its children. Does anyone know what I am doing wrong?
Share Improve this question asked Jul 3, 2017 at 15:10 Vaida PlankyteVaida Plankyte 1131 gold badge1 silver badge6 bronze badges 2- Possible duplicate of What's the difference between HTML 'hidden' and 'aria-hidden' attributes? – GrumpyCrouton Commented Jul 3, 2017 at 15:21
-
hidden
means hidden to everyone.aria-hidden
means hidden to screen readers and similar tools – Hassan Imam Commented Jul 3, 2017 at 18:02
1 Answer
Reset to default 6Thank you for your ments, it made me realise I was indeed confused by what the audit tool was checking.
I used the advice given on the w3 website regarding putting [aria-hidden="true"] { visibility: hidden; }
in my code, which properly hides the overlay when its aria-hidden property is set to true, and results in the audit tool being happy. :)