Skip to content

Fix wrapped row navigation in react-tree-grid#660

Merged
bsunderhus merged 2 commits into
mainfrom
fix/react-tree-grid-wrapped-row-navigation
Jun 22, 2026
Merged

Fix wrapped row navigation in react-tree-grid#660
bsunderhus merged 2 commits into
mainfrom
fix/react-tree-grid-wrapped-row-navigation

Conversation

@bsunderhus

Copy link
Copy Markdown
Contributor

Summary

Fix TreeGrid level navigation when virtualized rows are wrapped in additional container elements.

What changed

  • update useTreeGridLevelNavigation to traverse rows lazily within the current treegrid instead of relying on direct row siblings
  • preserve wrapped-row navigation behavior in the level-navigation unit tests
  • update the virtualized navigation fixtures to exercise wrapped TreeGridRow containers
  • add a Beachball patch changeset for @fluentui-contrib/react-tree-grid

Validation

  • yarn nx run react-tree-grid:test -- --testPathPattern=useTreeGridLevelNavigation.test
  • yarn nx run react-tree-grid:component-test --skipInstall

@bsunderhus bsunderhus requested a review from a team as a code owner June 22, 2026 07:22
@bsunderhus bsunderhus force-pushed the fix/react-tree-grid-wrapped-row-navigation branch from f35fa53 to 9eca12f Compare June 22, 2026 07:24
@bsunderhus bsunderhus force-pushed the fix/react-tree-grid-wrapped-row-navigation branch from 9eca12f to 518103e Compare June 22, 2026 08:19

const siblingLevel = Number(sibling.getAttribute('aria-level'));

if (Number.isNaN(siblingLevel)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Worth confirming: the walker now scans the whole treegrid rather than just direct siblings. If any role="row" without an aria-level can appear between data rows (e.g. a column-header row), it would hit this NaN branch and return none, disabling level navigation in that direction. Fine for the current fixtures since every row has a level — just flagging the assumption.

@bsunderhus bsunderhus merged commit aacc870 into main Jun 22, 2026
9 checks passed
@bsunderhus bsunderhus deleted the fix/react-tree-grid-wrapped-row-navigation branch June 22, 2026 08:41
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