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

Fix - focusable button for toc expand toggle #197

Merged
merged 2 commits into from
Aug 19, 2022

Conversation

lb-
Copy link
Member

@lb- lb- commented Aug 19, 2022

  • resolves Sidebar’s Toctree "Expand" buttons are impossible to use with a keyboard #104
  • adds a focusable (button) for the expand TOC toggle
  • include HTML template element to set up classes & translated screen reader description much easier
  • revise DOM position so it is the same visually as the tab order
  • move in slightly so focus outline is visible
  • also fixes an issue where the screen reader main menu label would not be translatable

Caveats

  • Positioning may be odd for screen readers as it is 'before' the content it is expanding - but this would be a more complex fix that requires ids to be added to each TOC item. Recommend we add aria-controls & aria-expanded attributes as a new improvement issue.
  • These changes will not support IE11 - but other recent code changes will break in IE11 anyway

Screen Shot 2022-08-19 at 5 10 03 pm

@lb- lb- force-pushed the fix/104-focusable-button-for-toc-expand-toggle branch from 7e87a8c to dcd7e5f Compare August 19, 2022 07:11
@lb- lb- requested review from vsalvino and tbrlpld August 19, 2022 07:12
- include HTML template element to set up classes & translated screen reader description
- revise DOM position so it is the same visually as the tab order
- move in slightly so focus outline is visible
- fixes #104
@lb- lb- force-pushed the fix/104-focusable-button-for-toc-expand-toggle branch from dcd7e5f to d733cd6 Compare August 19, 2022 07:14
Copy link
Contributor

@vsalvino vsalvino left a comment

Choose a reason for hiding this comment

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

Looks good and makes sense to me. I built the branch and it seems to behave well in the browser.

@lb- lb- merged commit 4188a7f into main Aug 19, 2022
@lb- lb- deleted the fix/104-focusable-button-for-toc-expand-toggle branch August 19, 2022 20:34
@lb-
Copy link
Member Author

lb- commented Aug 19, 2022

As a follow up - we should raise two new issues

  • improvement to the screen reader experience for collapsing TOC sections
  • add a skip link to the oage

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.

Sidebar’s Toctree "Expand" buttons are impossible to use with a keyboard
2 participants