Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External copy paste handlers #2981

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adam-kuhn
Copy link

This PR adds two callback props for the copy and paste events. The new props allow developers to write their own logic for the copy and paste events. Thereby, allowing the devs to respond to the events as they see fit, by having all of the logic outside of react-data-grid.

The primary limitations of the internal copy/paste logic provided by react-data-grid, is the inability to copy/paste items from external sources by writing to the clipboard. As well as the limitation of only being able to copy one cell at a time. By letting developers write there own logic to these events, these use cases can be addressed by enabling the dev to write their own logic.

Possible use cases for these two props:

  • copying values to the clipboard
  • pasting values from the clipboard
    • allows the user to paste data that was copied from outside of react-data-grid
  • copying from multiple cells
  • pasting to multiples cells

}: {
onPasteCallback?: boolean;
onCopyCallback?: boolean;
externalCopy?: boolean;
externalPaste?: boolean;

Choose a reason for hiding this comment

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

I would try to keep the "on" convention they have in the previous callers, just to keep aligned with their code style.

Code looks good and thanks for this improvement, I am looking forward to this change too.

@DVGY
Copy link

DVGY commented Jul 2, 2023

This is a feature Which I need

@flipvh
Copy link

flipvh commented Feb 10, 2024

Hi @DVGY do you still need this feature or did you find another way? Thanks!!

@DVGY
Copy link

DVGY commented Feb 11, 2024

Hi @DVGY do you still need this feature or did you find another way? Thanks!!

Still need this feature

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.

4 participants