Repository navigation
Conversation
Each color group in the Font Color and Highlight color callouts is a
FocusZone with handleTabKey={FocusZoneTabbableElements.all} and
isCircularNavigation. The zone handled Tab/Shift-Tab itself and wrapped
them inside the group, so keyboard users couldn't get back to
"Automatic"/"No color" or move on to "Standard colors".
Remove handleTabKey so the zone uses its default. Each group is now one
Tab stop, and the arrow keys still move between swatches (circular).
Add SwatchColorPickerGroup tests for Tab/Shift-Tab leaving the group,
circular arrow keys and the single Tab stop.
Fixes pnp#1944
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Title: RichText: fix keyboard focus trapped in Font Color / Highlight color swatch groups
What's in this Pull Request?
Every color group in the Font Color and Highlight color callouts is rendered by
SwatchColorPickerGroup, which wrappedits swatches in a
FocusZonewithhandleTabKey={FocusZoneTabbableElements.all}andisCircularNavigation. The zonetook Tab/Shift-Tab and wrapped them inside the group, so focus could never get back to "Automatic" / "No color" or move
on to "Standard colors".
Changes:
SwatchColorPickerGroup.tsx: removedhandleTabKey(and the now unused import), as proposed in the issue. Each group is now asingle Tab stop: Tab/Shift-Tab move between the default button and the groups, and Left/Right move between swatches
inside a group (still circular).
SwatchColorPickerGroup.test.tsx(new): Tab on the last/middle swatch and Shift-Tab on the first swatch leave thegroup, arrow keys wrap at both ends, one Tab stop per group. The three Tab tests fail on
devand pass with the fix.Testing:
npm run buildpasses on Node 22 (all jest suites green, no new lint warnings).in the color pickers.
No public API change. I left out the optional
bidirectionalswitch from my issue comment (Up/Down between swatchrows), and #1942 / #1943 will be separate PRs.