-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wrapFocus): add experimental option to wrap focus without sentine…
…ls (#15868) * fix(ComposedModal): add option to wrap focus without sentinels * feat(wrapFocus): add wrapFocusWithoutSentinels * chore(wrapFocus): place new behavior behind a feature flag * docs(focuswrap): add feature flag stories for new wrap focus * docs(focuswrap): remove feature flag info from default mdx
- Loading branch information
1 parent
79989d5
commit 2e4d9fa
Showing
16 changed files
with
1,438 additions
and
80 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains 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
This file contains 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
27 changes: 27 additions & 0 deletions
27
packages/react/src/components/ComposedModal/ComposedModal.featureflag.mdx
This file contains 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,27 @@ | ||
# ComposedModal | ||
|
||
[Source code](https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/ComposedModal) | ||
| | ||
[Usage guidelines](https://www.carbondesignsystem.com/components/modal/usage) | ||
| | ||
[Accessibility](https://www.carbondesignsystem.com/components/modal/accessibility) | ||
|
||
## Experimental focus wrap without sentinels | ||
|
||
`ComposedModal` supports the `enable-experimental-focus-wrap-without-sentinels` | ||
feature flag. This enables a new approach to the focus wrap behavior that | ||
modifies the DOM to no longer include hidden "sentinel nodes" used to mark the | ||
beginning and end of the wrapped focus. The new behavior looks at all | ||
interactive child nodes and wraps focus based on tabbable order of those nodes. | ||
The focus direction is determined whether `tab` is being pressed (forward) or | ||
`shift`+`tab` is being pressed (backwards). In javascript you can enable this | ||
feature flag to use the new focus wrap behavior. | ||
|
||
```js | ||
<FeatureFlags | ||
flags={{ | ||
'enable-experimental-focus-wrap-without-sentinels': true, | ||
}}> | ||
<ComposedModal /> | ||
</FeatureFlags> | ||
``` |
Oops, something went wrong.