fix(theme): add aria-label to skip to content link region#7982
fix(theme): add aria-label to skip to content link region#7982slorber merged 6 commits intofacebook:mainfrom YoniChechik:patch-1
Conversation
| const {containerRef, handleSkip} = useSkipToContent(); | ||
| return ( | ||
| <div ref={containerRef} role="region"> | ||
| <div ref={containerRef} role="region" aria-label="Skip to main content"> |
There was a problem hiding this comment.
Could you add a translation? It would share the same key as the main content.
There was a problem hiding this comment.
Should be fixed
div role="region"
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
| <div ref={containerRef} role="region" aria-label={<Translate | ||
| id="theme.common.skipToMainContentAriaLabel" | ||
| description="The skip to content aria label used for accessibility of the region div "> | ||
| Skip to main content | ||
| </Translate>}> |
There was a problem hiding this comment.
You should use translate. JSX elements are objects, not strings. You can check the other aria-labels:
It also needs to be formatted. If you don't want to check this out locally and run format, I can do that for you later.
Also, no need to add another id; just reuse the exact same thing from the <Translate> element. translate({ id: "theme.common.skipToMainContent" }) should be sufficient already.
There was a problem hiding this comment.
fixed. Thanks for the help. I'm not really a JS pro...
|
Okay, it's good from my side. I would check this out locally and if it works as expected we can merge it. |
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
fixes #7981
Pre-flight checklist
Motivation
Test Plan
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs