Copy + Paste keyboard command for alternating cells

Tags: #<Tag:0x00007efc71a7c690>

Hi. I would like to seek for a workaround with copy + paste keyboard commands for alternating cells.

When I copy selected cells, only the value from the last cell is displayed,
Screenshot_24 Screenshot_23

Is this something supported in the component or is it part of the security limitations for paste?

Thanks,
Karla

Hi Karla,

The non-continuous selection does not support copyPaste yet. This subject can be tracked under this issue https://github.com/handsontable/handsontable/issues/4878

beforePaste hook returns an array of changes where we set up only values, without coordinates, so

This is the result of pasting horizontal data
image

Here is vertical data
image

and an array where we have a range of cells for a couple of rows and columns
image

We do not, however, have a structure for multiple cells/ranges that are non-contiguous. That would probably cause a breaking change in the way we pass data related to paste.

As a workaround, you can try to block the Handontable paste event and replace it with custom logic (for example with the setDataAtCell method). But then you would also need to read the data from selected cells with a piece of custom logic.

Thanks for responding.
I found a workaround by capturing the values of non-continuous selected cells using getDataAtCell method in beforeCopy event and use setDataAtCell in beforePaste event as part of the custom logic. Still testing the logic with other use cases to improve further.

Great! Thank you for feedback @karlytebia