Unable to paste/edit value to cell that has array value

Tags: #<Tag:0x00007efc648add08>

Handsontable can accept value as array for each cell, it will automatically to paste to string (with comma as join) for text renderer. but we can’t edit or paste value to the cell any more.

Please look at the codesandbox
https://codesandbox.io/s/handsontable-react-data-grid-hello-world-app-forked-f335p6?file=/src/constants.ts:767-784

We pass value as array for row 6 col 1 ([“Jaxbean”, “test”]) which handsantable can render correctly. but when we try to change value or paste the value to the cell, it doesn’t update value.

In our case, we implement a custom renderer for dropdown and it can be selected multiple, it works perfectly fine but only one problem we can paste the value to the dropdown that has the previous value.

Is there any workaround ?

Hi @elecwebmaker

Handsontable is tested with an array of objects or an array of arrays (as shown in those examples) https://handsontable.com/docs/javascript-data-grid/binding-to-data/. Adding another level of testing might work with the core functionalities but wasn’t tested with plugins. If you’d like to hold more data than a single primitive, we recommend using cell meta or a custom cell editor/renderer.

@aleksandra_budnik

We actually already use custom cell render/editor since we implement our own dropdown for select multiple options as I mentioned. change value is work fine. but it doesn’t work for paste.

is there any way we can update logic for paste by ourself? we tried beforePaste but it seem like issue happened before hook being called. My guess is it has something wrong with previous value that has array because if we paste value when the cell is empty, it can paste with no problem, but after it has value as array (user select dropdown item), it can’t be paste anymore

It seems that here we have the explanation https://github.com/handsontable/handsontable/issues/9811