Skip to content

Commit

Permalink
TileGrid: invalidateLayout not always called anymore on tile insertion
Browse files Browse the repository at this point in the history
This happens since 4040e05.
  • Loading branch information
cguglielmo committed Jun 11, 2024
1 parent bd8529d commit 8c45d06
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions eclipse-scout-core/src/tile/TileGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,19 @@ export class TileGrid<TTile extends Tile = Tile> extends Widget implements TileG
}

protected _renderInsertTiles(tiles: (TTile | PlaceholderTile)[]) {
if (!this.animateTileInsertion) {
return;
if (this.animateTileInsertion) {
this._animateInsertTiles(tiles);
}
tiles.forEach(tile => {
if (!this.htmlComp.layouting) {
// no need to invalidate when tile placeholders are added or removed while layouting
this.invalidateLayoutTree();
}
}

protected _animateInsertTiles(tiles: (TTile | PlaceholderTile)[]) {
for (let tile of tiles) {
if (!tile.rendered) {
return;
continue;
}
tile.$container.addClass('before-animate-insert');
// Wait until the layout animation is done before animating the insert operation.
Expand All @@ -442,11 +449,6 @@ export class TileGrid<TTile extends Tile = Tile> extends Widget implements TileG
}
}
});
});

if (!this.htmlComp.layouting) {
// no need to invalidate when tile placeholders are added or removed while layouting
this.invalidateLayoutTree();
}
}

Expand Down

0 comments on commit 8c45d06

Please sign in to comment.