-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add "Skip to content" button #5773
Add "Skip to content" button #5773
Conversation
Closes #5587
Disable ripple effect
Upgrade test dependencies
Fix Notification component colors
Add component prop to SimpleForm
Change Notification's error color from dark to main
Allow MenuItemLink to receive TooltipPops
List - Optional Sync With Location
Awesome! I'm a bit concerned by the fact that https://github.com/rafgraph/react-router-hash-link only works with BrowserRouter. And I think that, since you know the target element is not focusable (it's a div), you can replicate react-router-hash-link's focus management inside an |
Good shout, I managed to get rid of the hash-link package by mimicking their implementation. If no element is found from the |
Yes and only in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
What's missing? The PR title is still prefixed with |
I had trouble in the Cypress test. Specifically when it came to determining the focus position after clicking 'Skip to content' button. It seems that because divs don't have focus, I can't use the Other than that everything else is done. I'll leave it with you folks to determine whether enough's here to merge in, or whether you want a more comprehensive test included. |
Do you mind rebasing on the latest commit of the |
…34/react-admin into feature/skip-to-content-button
…34/react-admin into feature/skip-to-content-button
I fudged the rebase a little! I'll try and revert |
closing in favour of: #5804 |
Description
I've added a button inside of
Layout.tsx
that only displays when the first action a user performs on a RA site is pressing the tab button.This moves the focus into the main content of the website, avoiding having to tab through the top and side menus.
While the functionality is complete, I'm going to write Cypress tests for this functionality.
Notes:
Because navigating to anchors via the
#
didn't seem to work nicely withHashRouter
, I had to install an node module that exports a custom link. Here's a link to the discussionFortunately the module has no dependencies, and it works out of the box.
I implementing this component similarly to how it's written inside of the Material-UI repo. You can view their implementation here
skip-navigation-smol.mov