-
Notifications
You must be signed in to change notification settings - Fork 1k
fix aria-hidden on anchor #7460
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
Conversation
class="c3" | ||
inert="" |
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.
I believe the markup could be just <a class="c3" tabindex="-1" inert>
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inert
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.
need to do inert=""
to get it to work.
More details here: facebook/react#17157
@britt6612 Where the suggestion says "Consider using the inert attribute instead, which will also prevent focus", is it incorrect HTML to be programmatically placing focus on an inert element? When I interact with this story, the focus isn't moved to the layer container, so I can't get into the layer Screen.Recording.2024-12-11.at.2.54.04.PM.mov |
@taysea |
In the referenced story, when the modal opens, the first child However, if you set modal prop to "false", this ancestor is not changed and no error is displayed in the console. Is it necessary to set |
You're right, it must've been related to that. If I close out the netlify deploy bar prior to interacting, then I don't have the issue. |
updated PR: I removed the This is because the
Since this was added we have enhanced our |
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.
Looks good!
What does this PR do?
This PR fixes an console log error that was happening within Layer
Where should the reviewer start?
LayerContainer.js
What testing has been done on this PR?
locally check for console log
How should this be manually tested?
storybook
Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
The anchor element is focusable but is being hidden from assistive technologies with
aria-hidden="true"
using
inert
will prevent focus and hide the element from assistive technologies which is what we intend.What are the relevant issues?
closes #7459
Screenshots (if appropriate)
Do the grommet docs need to be updated?
no
Should this PR be mentioned in the release notes?
yes
Is this change backwards compatible or is it a breaking change?
backwards compatible