Skip to content

feat(react-components): migrate useArrowNavigationGroup to focusgroup where possible#35941

Draft
smhigley wants to merge 3 commits intomicrosoft:masterfrom
smhigley:focusgroup-experiment
Draft

feat(react-components): migrate useArrowNavigationGroup to focusgroup where possible#35941
smhigley wants to merge 3 commits intomicrosoft:masterfrom
smhigley:focusgroup-experiment

Conversation

@smhigley
Copy link
Copy Markdown
Contributor

@smhigley smhigley commented Apr 1, 2026

DRAFT/EXPERIMENTAL PR, DO NOT MERGE

This updates supported usage of useArrowNavigationGroup from react-tabster to the new focusgroup attribute.

Note: React does not currently support setting focusgroupstart in JSX/TSX, though I added the prop in anyway as a POC.

TODO: add polyfill once it's published (https://github.com/microsoft/polyfills/blob/main/packages/focusgroup/src/polyfill.js)

There are some exceptions that cannot currently be migrated to focusgroup:

  • any use where the axis grid or grid-linear, since grid is not yet supported by focusgroup
  • Any use of tabbable, since focusgroup does not support dual arrowing + tabbing behavior (this also doesn't really have precedent in established keyboard patterns). Right now, the only use is in Nav, and the soon-to-be-deprecated Accordion behavior that allows arrowing
  • CarouselSlider, since there is currently no way to set focusgroup: none wrapping inner CarouselCard content without adding an extra <div>

type: 'button',
'aria-selected': `${!!isSelected}`,
...defaultTabProps,
focusGroupStart: isSelected,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
focusGroupStart: isSelected,
focusgroupstart: isSelected,

Maybe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out the issue was that it needed a string value, it wasn't getting applied as a boolean attribute. I need to dig in a little more on why, but I've pushed an update setting them as strings for now so folks can at least test it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants