I have a spreadsheet interface (jspreadsheet) and I want to be able to collaboratively edit it.
I have created a binding. When the binding is initialized I push the data to yjs:
const data = ydoc.getArray("mytable");
const tblData = table.getData(); // the array of arrays containing the spreadsheet data
ydoc.transact(() => {
for (let i = 0; i < tblData.length; i += 1) {
const yarray = new Y.Array();
yarray.insert(0, tblData[i]);
data.push([yarray]);
}
});
Now when I change a cell (x, y, value), I do the following:
I updated one cell, expected to see the change in deltas. I have checked the deltas and get only one delete with one number and an insert with one integer.
I think I spotted the issue: in my case, it would be enough to change the child array and use observeDeep: