Skip to content

Commit 93e7d94

Browse files
committed
Avoid switching grid items with same (x, y)
1 parent 6d756de commit 93e7d94

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/helpers/utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,14 @@ export function setTopRight(top, right, width, height): Object {
380380
*/
381381
export function sortLayoutItemsByRowCol(layout: Layout): Layout {
382382
return [].concat(layout).sort(function(a, b) {
383+
if (a.y === b.y && a.x === b.x) {
384+
return 0;
385+
}
386+
383387
if (a.y > b.y || (a.y === b.y && a.x > b.x)) {
384388
return 1;
385389
}
390+
386391
return -1;
387392
});
388393
}

0 commit comments

Comments
 (0)