-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Use native copy/paste event handlers #3667
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Hi are there currently plans to add this feature? It would be very appreciated for my use case |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3667 +/- ##
==========================================
+ Coverage 98.75% 98.80% +0.05%
==========================================
Files 47 47
Lines 3447 3424 -23
Branches 750 743 -7
==========================================
- Hits 3404 3383 -21
+ Misses 43 41 -2
🚀 New features to boost your workflow:
|
src/index.ts
Outdated
@@ -34,8 +34,7 @@ export type { | |||
SelectHeaderRowEvent, | |||
SelectRowEvent, | |||
FillEvent, | |||
CopyEvent, | |||
PasteEvent, | |||
CellCopyPasteEvent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add two separate events (CellCopyEvent
and CellPasteEvent
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can do
type CellCopyEvent = CellCopyPasteEvent;
type CellPasteEvent = CellCopyPasteEvent;
and export those instead, it'll be safer to extend one or the other in the future.
}} | ||
/> | ||
<> | ||
{copiedCell && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there is is another way to set copied cell styles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if I copy something outside the grid then pastes it onto a cell?
src/index.ts
Outdated
@@ -34,8 +34,7 @@ export type { | |||
SelectHeaderRowEvent, | |||
SelectRowEvent, | |||
FillEvent, | |||
CopyEvent, | |||
PasteEvent, | |||
CellCopyPasteEvent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can do
type CellCopyEvent = CellCopyPasteEvent;
type CellPasteEvent = CellCopyPasteEvent;
and export those instead, it'll be safer to extend one or the other in the future.
Users can decide how to handle it. In the example, I am updating the cell
|
onCellCopy
andonCellPaste
propsonCopy
andonPaste
eventsFixes
#2736
#1950