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

Hiding things example - description not aligned with code #30171

Closed
Liz-Matmos opened this issue Nov 10, 2023 · 6 comments
Closed

Hiding things example - description not aligned with code #30171

Liz-Matmos opened this issue Nov 10, 2023 · 6 comments
Labels
Content:Learn:Accessibility Accessibility documentation in the Learn Area effort: medium This task is a medium effort.

Comments

@Liz-Matmos
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Learn/Accessibility/CSS_and_JavaScript

What specific section or headline is this issue about?

Hiding things

What information was incorrect, unhelpful, or incomplete?

The example shown uses a tabs widget, and tabpanel content that is not visible is discoverable by screen readers due to the absolute positioning. The content reads:

Absolute positioning (as used in this example) is generally seen as one of the best mechanisms of hiding content for visual effect because it doesn't stop screen readers from getting to it.

and

On the other hand, you shouldn't use visibility:hidden or display:none, because they do hide content from screen readers.

What did you expect to see?

Does this not cause an issue for sighted screen reader users? Wouldn't the best approach for the example given be to use display:none; as per the APG Tabs pattern?

Do you have any supporting links, references, or citations?

APG guidance as above. Many screen reader users have some vision, and generally what they hear and see should be in harmony.

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@Liz-Matmos Liz-Matmos added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 10, 2023
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:Learn:Accessibility Accessibility documentation in the Learn Area labels Nov 10, 2023
@pepelsbey pepelsbey added the effort: medium This task is a medium effort. label Nov 22, 2023
@pepelsbey
Copy link
Member

Hey! Thank you for bringing this up. You’re absolutely right: this particular example is not fully accessible. Not just because of the positioning but also because it lacks focus management, needed ARIA roles, etc. The whole section needs to be rewritten.

@Liz-Matmos
Copy link
Author

Thanks @pepelsbey - I discovered this content as I am studying for the WAS exam and it is referenced in the Body of Knowledge, so it would be great to have amended!

@teoli2003
Copy link
Contributor

@Liz-Matmos Maybe are you interested in submitting a PR with the needed changes? It would help us fix it more quickly.

@pepelsbey pepelsbey removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 23, 2023
@pepelsbey
Copy link
Member

As for the potential fix, I’d suggest using something else instead of improving this example. There are some good thoughts/examples in these articles:

https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html
https://www.scottohara.me/blog/2023/03/21/visually-hidden-hack.html

@Josh-Cena Josh-Cena removed the Content:CSS Cascading Style Sheets docs label Jun 10, 2024
@Josh-Cena
Copy link
Member

The code is fixed by mdn/learning-area#745. Welcoming a PR to change the description.

@Josh-Cena Josh-Cena changed the title Hiding things example - using absolute positioning Hiding things example - description not aligned with code Sep 2, 2024
@pepelsbey
Copy link
Member

Should be fixed in mdn/learning-area#745 Let me know if there's anything left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn:Accessibility Accessibility documentation in the Learn Area effort: medium This task is a medium effort.
Projects
None yet
Development

No branches or pull requests

4 participants