Skip to content

Commit 1dcb96d

Browse files
authored
Merge pull request jbaysolutions#442 from pieterbeulque/master
Fix wrong grid item sorting in responsive mode
2 parents 57aa4b5 + 729a27e commit 1dcb96d

7 files changed

+297
-20196
lines changed

dist/vue-grid-layout.common.js

Lines changed: 144 additions & 10096 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.js

Lines changed: 144 additions & 10096 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)