Skip to content

T1338023 - TreeList / DataGrid - Focused cell loses DOM focus after a partial update - #36269

Open
bit-byte0 wants to merge 3 commits into
DevExpress:mainfrom
bit-byte0:fix/focused-cell-loses-focus-partial-update
Open

bit-byte0 wants to merge 3 commits into
DevExpress:mainfrom
bit-byte0:fix/focused-cell-loses-focus-partial-update

Conversation

@bit-byte0

Copy link
Copy Markdown
Contributor

What

Fixed the focused cell losing focus when the focused row is updated in place with repaintChangesOnly, e.g. TreeList expandRow

How

The stale focused row cleanup now runs only when another row still has the focused row highlight

@bit-byte0
bit-byte0 requested a review from a team as a code owner November 12, 2026 19:09
@bit-byte0 bit-byte0 added the 26_2 label Nov 12, 2026
Copilot AI balanced review requested due to automatic review settings November 12, 2026 19:09
@bit-byte0 bit-byte0 self-assigned this Nov 12, 2026

Copilot AI left a comment

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.

🟡 Changes recommended

An in-place row update can remove the focused row’s tabindex without restoring it, leaving TreeList row-focus mode with no target for instance.focus(); the fix also needs a regression test.

1 open issue
What changed in this PR

This PR addresses focused-cell DOM focus loss during repaintChangesOnly updates in the shared DataGrid/TreeList focus controller.

Changes:

  • Restricts focused-row cleanup to updates where another row still has the focused highlight.
  • Reuses focused-row lookup logic for detection and cleanup.
  • Adds a TreeList regression test verifying that expansion preserves the focused cell’s tabindex and DOM focus.
File Description
packages/​devextreme/​js/​__internal/​grids/​tree_list/​__tests__/​focus_navigation.integration.test.ts Tests cell-focus preservation during partial updates caused by row expansion.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​focus/​focus.ts Adds stale-highlight detection to guard focused-row cleanup.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 09:32

Copilot AI left a comment

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.

🟡 Changes recommended

The case-sensitive tabindex lookup ignores the configured tabIndex when restoring row focus after partial updates, potentially returning rows to sequential keyboard navigation unexpectedly.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 09:53

Copilot AI left a comment

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.

🟢 Approval recommended

No active review issues remain for the TreeList/DataGrid focus-preservation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants