Skip to content

fix(data-grid): prevent column header sorting popover from closing when cell is focused#1114

Merged
sadmann7 merged 2 commits into
mainfrom
sadman/fix-sort-popover-closes-on-cell-focus
Feb 24, 2026
Merged

fix(data-grid): prevent column header sorting popover from closing when cell is focused#1114
sadmann7 merged 2 commits into
mainfrom
sadman/fix-sort-popover-closes-on-cell-focus

Conversation

@sadmann7
Copy link
Copy Markdown
Owner

Expand getIsInPopover to include Radix dropdown and popover content. When a cell was focused and the user clicked a column header to sort, the grid's focusout handler was stealing focus back to the cell because the dropdown content wasn't recognized as a valid popover. This caused the sorting popover to close immediately.

Fixes #1108

…focused

Expand getIsInPopover to include Radix dropdown and popover content. When
a cell was focused and the user clicked a column header to sort, the
grid's focusout handler was stealing focus back to the cell because the
dropdown content wasn't recognized as a valid popover. This caused the
sorting popover to close immediately.

Fixes #1108

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings February 24, 2026 08:44
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tablecn Ready Ready Preview, Comment Feb 24, 2026 8:52am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a bug where the column header sorting dropdown would close immediately when a table cell was focused. The issue occurred because the data grid's focus management logic didn't recognize Radix UI dropdown and popover content as valid popup contexts, causing focus to be incorrectly reclaimed from the sorting dropdown.

Changes:

  • Expanded getIsInPopover utility function to recognize Radix UI dropdown-menu-content and popover-content elements
  • Refactored the function logic to use early return pattern for better readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/data-grid.ts
@sadmann7 sadmann7 merged commit 5bd32f4 into main Feb 24, 2026
7 checks passed
@sadmann7 sadmann7 deleted the sadman/fix-sort-popover-closes-on-cell-focus branch February 24, 2026 08:54
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.

[bug]: Column Header Sorting Popover Closes Immediately When Cell Is Focused

2 participants