Skip to content

fix: clear multiselect and file cells with appropriate empty values - #1030

Merged
sadmann7 merged 2 commits into
mainfrom
clear-cells
Nov 20, 2025
Merged

sadmann7 merged 2 commits into
mainfrom
clear-cells

Conversation

@sadmann7

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 20, 2025 13:07
@vercel

vercel Bot commented Nov 20, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
shadcn-table Ready Ready Preview Comment Nov 20, 2025 1:12pm
tablecn Ready Ready Preview Comment Nov 20, 2025 1:12pm

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.

Pull Request Overview

This PR fixes the handling of cell clearing operations for multiselect and file cells by using appropriate empty values instead of empty strings. The fix ensures that when users delete or clear cells via keyboard shortcuts or context menu, different cell types receive semantically correct empty values (arrays for multi-select/file, null for number/date, false for checkbox, and empty string for text).

Key Changes

  • Updated keyboard delete handler and context menu clear action to determine cell variant and assign appropriate empty values
  • Fixed MultiSelectCell and FileCell components to properly sync their internal state when cell values change externally
  • Removed obsolete comment about clearing search input in MultiSelectCell

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/hooks/use-data-grid.tsx Added logic to detect cell variants and assign appropriate empty values ([], null, false, or "") when clearing cells via Delete/Backspace keys
src/components/data-grid/data-grid-context-menu.tsx Added same cell variant detection logic for context menu "Clear" action and updated dependency array to include table
src/components/data-grid/data-grid-cell-variants.tsx Added state synchronization when cellValue changes for MultiSelectCell and FileCell; removed obsolete comment
public/r/data-grid.json Updated component content to reflect the changes (registry update)

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

Comment thread src/components/data-grid/data-grid-cell-variants.tsx
Comment thread src/components/data-grid/data-grid-cell-variants.tsx
@sadmann7
sadmann7 merged commit ddad283 into main Nov 20, 2025
7 checks passed
@sadmann7
sadmann7 deleted the clear-cells branch November 20, 2025 13:12
noodleman1991 pushed a commit to noodleman1991/tablecn that referenced this pull request Mar 12, 2026
…admann7#1030)

* fix: clear multiselect and file cells with appropriate empty values

* fix: revoke object URLs in FileCell to prevent memory leaks
anhdd-kuro pushed a commit to anhdd-kuro/tablecn that referenced this pull request Apr 8, 2026
…admann7#1030)

* fix: clear multiselect and file cells with appropriate empty values

* fix: revoke object URLs in FileCell to prevent memory leaks

This branch was successfully deployed

2 active deployments
Preview – shadcn-table — 0af18220 Deployed Nov 20, 2025 by vercel[bot]
Preview – tablecn — 0af18220 Deployed Nov 20, 2025 by vercel[bot]
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