Skip to content

Commit da8ba57

Browse files
committed
auto-size content batch mode
* fix #404 * make sure to use batch mode to improve re-layout
1 parent 4fc6a7b commit da8ba57

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/gridstack-engine.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export class GridStackEngine {
6060
if (flag) {
6161
this._prevFloat = this._float;
6262
this._float = true; // let things go anywhere for now... will restore and possibly reposition later
63+
this.cleanNodes();
6364
this.saveInitial(); // since begin update (which is called multiple times) won't do this
6465
} else {
6566
this._float = this._prevFloat;

src/gridstack.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ export class GridStack {
727727
public batchUpdate(flag = true): GridStack {
728728
this.engine.batchUpdate(flag);
729729
if (!flag) {
730+
this._updateContainerHeight();
730731
this._triggerRemoveEvent();
731732
this._triggerAddEvent();
732733
this._triggerChangeEvent();
@@ -1580,6 +1581,8 @@ export class GridStack {
15801581
this.prevWidth = this.el.clientWidth
15811582
// console.log('onResize ', this.el.clientWidth);
15821583

1584+
this.batchUpdate();
1585+
15831586
// see if we're nested and take our column count from our parent....
15841587
let columnChanged = false;
15851588
if (this._autoColumn && this.parentGridItem) {
@@ -1611,6 +1614,8 @@ export class GridStack {
16111614
}
16121615
});
16131616

1617+
this.batchUpdate(false);
1618+
16141619
return this;
16151620
}
16161621

0 commit comments

Comments
 (0)