Skip to content

feat(data-grid): add onPaste callback hook - #1033

Merged
sadmann7 merged 1 commit into
mainfrom
add-onpaste-callback
Nov 21, 2025
Merged

sadmann7 merged 1 commit into
mainfrom
add-onpaste-callback

Conversation

@sadmann7

Copy link
Copy Markdown
Owner
  • Add onPaste callback to UseDataGridProps interface
  • Call onPaste with updates array before applying changes
  • Allows users to hook into paste operations for API calls

- Add onPaste callback to UseDataGridProps interface
- Call onPaste with updates array before applying changes
- Allows users to hook into paste operations for API calls
Copilot AI review requested due to automatic review settings November 21, 2025 18:27
@vercel

vercel Bot commented Nov 21, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Updated (UTC)
shadcn-table Ready Ready Preview Nov 21, 2025 6:27pm

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 adds a new onPaste callback hook to the data grid, enabling users to intercept paste operations before data is committed. The callback receives the array of cell updates and can be used to perform API calls or other side effects during paste operations.

Key Changes

  • Added onPaste optional callback to the UseDataGridProps interface
  • Integrated onPaste invocation in the paste flow before applying cell updates
  • Included onPaste in the pasteCells dependency array for proper React lifecycle management

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
src/hooks/use-data-grid.tsx Added onPaste callback parameter and integrated it into the paste operation flow
public/r/data-grid.json Updated registry content to reflect the new onPaste callback in the hook

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

@sadmann7
sadmann7 merged commit 75693d7 into main Nov 21, 2025
13 checks passed
@sadmann7
sadmann7 deleted the add-onpaste-callback branch November 24, 2025 12:02
noodleman1991 pushed a commit to noodleman1991/tablecn that referenced this pull request Mar 12, 2026
- Add onPaste callback to UseDataGridProps interface
- Call onPaste with updates array before applying changes
- Allows users to hook into paste operations for API calls
anhdd-kuro pushed a commit to anhdd-kuro/tablecn that referenced this pull request Apr 8, 2026
- Add onPaste callback to UseDataGridProps interface
- Call onPaste with updates array before applying changes
- Allows users to hook into paste operations for API calls

This branch was successfully deployed

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