admin管理员组文章数量:1355713
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. :)
本文标签: javascriptariahidden property not working on descendantsStack Overflow
版权声明:本文标题:javascript - aria-hidden property not working on descendants - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743941365a2565622.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论