Ability to move/modify cells for array values.
Here's the unit test that specifies this isn't allowed:
it('should not be possible to move cells to area with matrix', () => {
const [engine] = HyperFormula.buildFromArray({ cells: [
[{ cellValue: '1' }, { cellValue: '2' }],
[{ cellValue: '=TRANSPOSE(A1:B1)' }],
]})
expect(() => {
engine.moveCells(AbsoluteCellRange.spanFrom(adr('A1'), 2, 1), adr('A2'))
}).toThrowError('Cannot perform this operation, target location has an array inside.')
})
Google sheets allows this and there's no real reason to not allow it imo so it would be a good feature.
For example when you do a cut/paste it doesn't work on array cells.
I think this is actually a bug and not a feature. @warpech Could this issue label be changed please to 'bug'?
Because it's correct that users cannot copy/cut paste child array cells but the topLeft most cell should be allowed to be moved.
I think we might pick this bug up soon cause it's quit annoying for users to not be able to do this on arrays.
This error was explicitly added in a commit very early on https://github.com/handsontable/hyperformula/commit/6648a23566a1a807efe972e802db62c3b469ae78. My best guess is that the reason was that it requires some additional deoptimization, but I am not sure. We will check.
@MartinDawson I can confirm it's a bug. moveCells should allow overriding the array formulas by moving content into the top-left corner of an array.
Related: #131