Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ecc9293

Browse files
committed
fix auto-positioning
1 parent 755c865 commit ecc9293

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gridstack.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@
174174

175175
for (var i = 0; ; ++i) {
176176
var x = i % this.width, y = Math.floor(i / this.width);
177+
if (x + node.width > this.width) {
178+
continue;
179+
}
177180
if (!_.find(this.nodes, function (n) {
178181
return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n);
179182
})) {

0 commit comments

Comments
 (0)