Posted 29 December 2023, 7:51 am EST
Hi,
In Excel, pressing the delete key resets the internal clipboard, and you can verify this by attempting to paste after pressing delete in Excel. However, the copy-paste behavior in SpreadJS with Ctrl+C and Ctrl+V works differently. It utilizes both the system clipboard and internal clipboard but gives preference to the system clipboard.
Here’s how the copy-paste process works in SpreadJS with Ctrl+C and Ctrl+V:
-
When copying content in the worksheet with Ctrl+C, SpreadJS performs an internal copy (marking the range in the internal clipboard) and an external copy (writing the copied content into the system clipboard).
-
When pasting with Ctrl+V in the worksheet, SpreadJS retrieves the content from the system clipboard and compares it with the internal clipboard. If they differ, it pastes the content from the system clipboard. If they are the same, it handles the paste internally, copying all data (value, style, formula, conditional format, data validation, etc.) from the source cell and pasting it into the targeted cell.
So, when you copy with Ctrl+C, the system clipboard contains “Wednesday, February 01, 2023,” and the internal clipboard has information about the range of cells. Upon pasting for the first time, the content is pasted internally because the system clipboard and internal clipboard match. If you press delete on the targeted cell, the dashed style on the border of the source cell is removed, indicating that the internal clipboard is reset and no longer has information about the source cells. Only the value was cleared in the targeted cell, but the cell still has the date format.
Now, after pressing delete, if you try to paste again on the same cell (which still has the date format), and the internal clipboard has no information about the source cells, the system clipboard data will be pasted. However, the observed behavior is that SpreadJS is showing “2/1/2023” instead of “Wednesday, February 01, 2023.” This has been escalated to the developer, and I will update you as soon as I receive more information. The internal tracking id for the same is: SJS-22113
Best regards,
Ankit