Closed frantic0 closed 3 years ago
Have you tried adding more columns ?
const cols = [[1100, 6], [300, 4]];
I tried adding some more columns and it gave an error
matrix.js:3 Uncaught RangeError: Invalid array length
at makeMatrix (matrix.js:3)
at makeMatrixFromItems (matrix.js:6)
at Object.findSpace (helper.js:37)
at add_remove.svx:52
at Array.reduce (<anonymous>)
at HTMLButtonElement.add (add_remove.svx:49)
https://github.com/vaheqelyan/svelte-grid/blob/master/src/utils/helper.js#L37 getRowsCount(items, cols)
returns NaN
The thing is, I am using a 2d array to find the position for an element https://github.com/vaheqelyan/svelte-grid/blob/master/src/utils/matrix.js#L6 After this line
if(!_row) return matrix
Adding this line to utils/matrix.js
- fixes the error (hardcoded)
for all layout column configurations
e.g.
if you have
sets all COL props to the new item to add