Posted 27 January 2023, 7:32 am EST
Hi Kim,
The clipboards used when copying a range from the context menu and when using Ctrl + C are different.
Because web apps cannot access the global clipboard, when you copy using the context menu, it uses the internal clipboard whereas when you copy using Ctrl + C, it uses the global clipboard. This explains why you are seeing different results.
Additionally, keep in mind that Excel has access to the system clipboard, which is why it might function there.
When the spread’s context menu is used to copy something, the value is saved in the internal clipboard of the spread rather than the system clipboard, and when the keyboard shortcut ctrl+v is used to paste something, the value from the system clipboard is preferred over the internal clipboard.
The preference for the value of the external(global) clipboard is intentional and by design. However, due to browser restrictions, SpreadJS is unable to access the system clipboard. As a result, internal copy from the context menu does not alter the contents of the system clipboard, which is why pressing Ctrl+V after copying from the context menu still pastes previously copied values from the system’s clipboard.
You might also modify the paste command to include your own unique activities. You can consult the forum case below, which addresses a similar case: https://www.grapecity.com/forums/spreadjs/programatically-trigger-paste-event-ctrl-v
I hope this clarifies your issue. Please let us know if you face any further issues. We would be happy to help you.
Regards,
Ankit