We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e93edd commit eefa1aeCopy full SHA for eefa1ae
index.js
@@ -24,10 +24,10 @@ const chunk = (arr, n) =>
24
25
const prepareData = ({ data, numColumns, itemsPerRow }) => {
26
const col = numColumns || itemsPerRow;
27
- const missing = data.length % col;
+ const missing = (col - (data.length % col)) % col;
28
return [
29
...data,
30
- ...Array.from(Array(col - missing)).map(() => ({ __empty: true }))
+ ...Array.from(Array(missing)).map(() => ({ __empty: true }))
31
];
32
};
33
0 commit comments