Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit b6836d6

Browse files
Scott HyndmanThomasBurleson
authored andcommitted
fix(gridList): Animated tile removal now triggers appropriate layout
Closes #1559. Closes #4811.
1 parent ba63159 commit b6836d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/gridList/grid-list.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
348348

349349
function getTileElements() {
350350
return [].filter.call(element.children(), function(ele) {
351-
return ele.tagName == 'MD-GRID-TILE';
351+
return ele.tagName == 'MD-GRID-TILE' && !ele.$$mdDestroyed;
352352
});
353353
}
354354

@@ -722,6 +722,9 @@ function GridTileDirective($mdMedia) {
722722
// Tile registration/deregistration
723723
gridCtrl.invalidateTiles();
724724
scope.$on('$destroy', function() {
725+
// Mark the tile as destroyed so it is no longer considered in layout,
726+
// even if the DOM element sticks around (like during a leave animation)
727+
element.$$mdDestroyed = true;
725728
unwatchAttrs();
726729
gridCtrl.invalidateLayout();
727730
});

0 commit comments

Comments
 (0)