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

Only use dialog on mobile #358

Merged
merged 3 commits into from
Sep 18, 2024
Merged

Only use dialog on mobile #358

merged 3 commits into from
Sep 18, 2024

Conversation

tombye
Copy link
Contributor

@tombye tombye commented Sep 12, 2024

What’s changed

Changed the role of the table of contents so it's only a dialog on mobile-sized screens, to better match its behaviour.

A proposed fix for #357

The table of contents JS didn't have tests so I added some before making these changes.

Identifying a user need

Users need parts of the page to have roles that match their behaviour, otherwise it's confusing because it doesn't match their expectations. This is most obvious when you're using a screen reader and the tech docs are displayed on a desktop-size screen. The table of contents is announced as a dialog but it doesn't popup when you click a button like a dialog or have any of the other associated behaviours like tabbing being constrained to the dialog.

I chose to remove the role completely on desktop because its contents are already wrapped in landmark roles ('search' and 'navigation') and every landmark you add introduces more stuff to navigate.

@tombye tombye force-pushed the only-use-dialog-on-mobile branch from 1b9a255 to 55c36d4 Compare September 12, 2024 14:24
Copy link
Contributor

@kr8n3r kr8n3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@tombye tombye force-pushed the only-use-dialog-on-mobile branch from b909310 to 280ce40 Compare September 18, 2024 12:53
@tombye tombye merged commit 13ada11 into main Sep 18, 2024
3 checks passed
@tombye tombye deleted the only-use-dialog-on-mobile branch September 18, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants