-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix the navigate regions focus style #45369
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4d5da8f
Fix navigateRegions focus style first pass.
afercia 3f7c4c5
Fix navigateRegions focus style in the Site editor first pass.
afercia 7efcc54
Use grid items to establish new stacking context.
afercia 64eb393
Abstract navigable region and make CSS more robust.
afercia 2ac420e
Simplify JS and add readme.
afercia a090f95
Clean up CSS and fix edge cases.
afercia 9f525f2
Use new theming accent color.
afercia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Simplify JS and add readme.
- Loading branch information
commit 2ac420e58d62d75a14c9e917ad7594c41baeac3c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/interface/src/components/navigable-region/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # NavigableRegion | ||
|
|
||
| `NavigableRegion` renders an ARIA landmark region that's meant to be used together with the `useNavigateRegions` component from the `@wordpress/components` package. The ARIA landmark is a `div` element with a `role="region"` attribute and an `aria-label` attribute. It's made focusable by the means of a `tabindex="-1"` attribute so that `useNavigateRegions` can set focus on it and allow keyboard navigation through the regions in the editor. | ||
|
|
||
| It also renders a child `div` element that is responsible to set a negative `z-index` stack level, to make sure the focus style is always visible, regardless of other elements that may cut-off the focus style outline otherwise. | ||
|
|
||
| It can use a CSS animation via the `motion` component. | ||
|
|
||
| ## Props | ||
|
|
||
| ### children | ||
|
|
||
| The component that should be rendered as content. | ||
|
|
||
| - Type: React Element | ||
| - Required: Yes | ||
|
|
||
| ### className | ||
|
|
||
| The CSS class that will be added to the classes of the wrapper div. | ||
|
|
||
| - Type: `String` | ||
| - Required: No | ||
|
|
||
| ### ariaLabel | ||
|
|
||
| A meaningful name for the ARIA landmark region. | ||
|
|
||
| - Type: `String` | ||
| - Required: Yes | ||
|
|
||
| ### motionProps | ||
|
|
||
| Properties of `motionProps` object will be used by the `motion` component to set a CSS animation on the wrapper div. | ||
|
|
||
| - Type: `Object` | ||
| - Required: No | ||
| - Default: `{}` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wonder if this should be moved to the components package insect it's meant to be used in conjunction with useNavigateRegions from that package.