Is this an issue or expected behavior of SpreadJS that differs from Excel?

Posted by: nguyendat012002 on 30 July 2025, 2:27 am EST

    • Post Options:
    • Link

    Posted 30 July 2025, 2:27 am EST

    Hi,

    I’m using SpreadJS Designer and I’ve encountered an issue related to copy/paste behavior with styled cells.

    Steps to reproduce:

    I have a cell (e.g., A1) with the value “example” and the bold style applied.

    I select the cell (without entering edit mode – no input cursor visible), and press Ctrl+C to copy.

    I paste into another cell → both value and bold style are pasted → :white_check_mark: This is expected.

    Now I double-click the original cell to enter edit mode, then select the value and press Ctrl+C.

    I paste into another cell → both value and bold style are pasted again → :x: This is different from Excel.

    Expected Behavior (based on Excel):

    When copying a value from within the cell (edit mode), only the plain value should be pasted — style should not be copied.

    Additional Observation:

    After step 5, if I copy a different plain text from somewhere else, and then go back to the original styled cell, enter edit mode, copy the value, and paste it elsewhere — only the value is pasted without style :white_check_mark:.

    Is this a known issue or the expected behavior in SpreadJS?

    Thanks!

  • Posted 31 July 2025, 1:47 am EST

    Hi,

    Apologies for the inconvenience caused.

    We can replicate the behavior difference between SpreadJS and Microsoft Excel when pasting a value. We are discussing this behavior difference with the concerned team and will update you once we get any information from their end.

    Internal Tracking ID: SJS-30918

    Kind Regards,

    Chirag Gupta

  • Posted 31 July 2025, 6:39 am EST - Updated 31 July 2025, 6:44 am EST

    Hi,

    Thanks for your patience while we discussed the behavior with the development team.

    The behavior is by design. When Microsoft Excel enters the Edit/Enter mode, the clipboard is cleared and the previously copied value cannot be pasted into a new cell. However, in SpreadJS, the previous value is retained in the Clipboard. Please refer to the screenshot below, which illustrates the same:

    Due to this difference, Excel immediately uses the System clipboard’s updated value, but SpreadJS uses the internal Clipboard value while pasting.

    Please let us know if you require any further assistance.

    Kind Regards,

    Chirag Gupta

  • Posted 31 July 2025, 10:25 pm EST

    Hi,

    I forgot to select all the steps before entering the cell and copying. Please follow my GIF to reproduce the issue.

    I understand the clipboard limitations in the browser, but why can’t SpreadJS paste only the value into cell D2?

    Thanks

  • Posted 31 July 2025, 11:09 pm EST - Updated 31 July 2025, 11:14 pm EST

    Hi,

    The behavior you illustrated in the attached GIF is correct. Let’s discuss each step one by one:

    1. Copy Cell A1 and paste in any other cell: Paste both value and formatting.
    2. Copy Cell A2’s value and paste in any other cell: The value copied does not match the previous value, which enforces the SpreadJS clipboard value to change, and only the value is pasted.
    3. Repeat Step 1
    4. Copy Cell A1’s value and paste in any other cell: The value copied previously is the same as the current copied value; therefore, the SpreadJS clipboard value remains, and the previously copied value is pasted.

    If both A1 and A2 contain the same value, the copied value will never change, and SpreadJS will function as described in Steps 3 and 4. Please refer to the following screenshot illustrating the same:

    This behavior is by design, making the clipboard policy more complex and robust.

    Please don’t hesitate to contact us if you have any additional questions.

    Kind Regards,

    Chirag Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels