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

Docs: fix focus issue #38191

Merged
merged 4 commits into from
Mar 10, 2023
Merged

Docs: fix focus issue #38191

merged 4 commits into from
Mar 10, 2023

Conversation

louismaximepiton
Copy link
Member

@louismaximepiton louismaximepiton commented Mar 7, 2023

Description

Remove tabindex="0" from the body.
Make the scrollspy documentation evolve a bit.

Motivation & Context

Make the focus on a specific element of the doc hard.

Small check:

  • open the two previews below
  • select a word by double tapping
  • press Tab

The main branch leads to skip links wherever you selected the word.
The preview leads to the next element.

As far as I can see, the body is still accessible from keyboard.

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • (NA) I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

NA.

@julien-deramond
Copy link
Member

I haven't checked the code nor what would be the impact in terms of accessibility around tabindex here.

But I'm so happy to be able in this PR to do what I did before: clicking anywhere in the page, then Tab, then the closest element is focused. TBH it's a nightmare to test visible focus without this behavior since the focus on the main page goes back to the main navbar each time; I had to use this new "trick": click on the copy button and Shift + Tab 😄

@patrickhlauke
Copy link
Member

i actually have no idea why we'd have a tabindex="0" on <body> ... so yeah, seems good to me

@mdo mdo merged commit 25579aa into main Mar 10, 2023
@mdo mdo deleted the main-lmp-docs-scrollspy-fix branch March 10, 2023 17:20
@mahilanmjd mahilanmjd mentioned this pull request Apr 16, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants