Use native copy/paste event handlers#3667
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:
|
| FillEvent, | ||
| CopyEvent, | ||
| PasteEvent, | ||
| CellCopyPasteEvent, |
There was a problem hiding this comment.
Should we add two separate events (CellCopyEvent and CellPasteEvent)?
There was a problem hiding this comment.
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.
Not sure if there is is another way to set copied cell styles
nstepien
left a comment
There was a problem hiding this comment.
What happens if I copy something outside the grid then pastes it onto a cell?
| FillEvent, | ||
| CopyEvent, | ||
| PasteEvent, | ||
| CellCopyPasteEvent, |
There was a problem hiding this comment.
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 |
|
just to advise future readers, this is a breaking changing. Would be nice to have some docs related to this, but basically now you need to handle the copy event and save what you need in a state to use it when you need. No more sourceRow in the paste event. Would be nice if this was opt-in. |
onCellCopyandonCellPastepropsonCopyandonPasteeventsFixes
#2736
#1950