Skip to content

Commit 8eb7e9a

Browse files
committed
MOBILE-5015 loading: Workaround to fix animation.leave not firing
1 parent 4740cc1 commit 8eb7e9a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/core/components/loading/loading.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ export class CoreLoadingComponent implements AsyncDirective, OnDestroy {
117117
if (CorePlatform.isIOS()) {
118118
this.mutationObserver.observe(this.element, { childList: true });
119119
}
120+
121+
// Emulate leave animation by adding a class and removing the element after the animation is done.
122+
// This is needed to solve animation.leave problem introduced in Angular 20.3.6.
123+
// @TODO: Remove this workaround when updating to Angular v21, as the problem should be fixed by then.
124+
const container = this.element.querySelector('.core-loading-container');
125+
if (container && !container?.classList.contains('hide-animation')) {
126+
container?.classList.add('hide-animation');
127+
128+
setTimeout(() => {
129+
container?.remove();
130+
}, 500);
131+
}
120132
} else {
121133
this.mutationObserver.disconnect();
122134
}

0 commit comments

Comments
 (0)