angular / angular/components

bug(table): ngOnDestroy clears view before route animations finish

Open
#8,057 27 comments 24 reactions 0 assignees View on GitHub
area: material/table P4
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Reproduction

https://angular-components-8057.stackblitz.io (updated to 9.2.4)

Steps to reproduce:
1. Navigate to "Page" and the table view is destroyed immediately.

#### Expected Behavior

Table should remain in DOM until animations finish.

#### Actual Behavior

Table is removed from DOM as soon as routing begins.

#### Environment

- Angular: 9.1.9
- CDK/Material: 9.2.4
- Browser(s): Google Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and trace what happens when routing begins, focusing on why the table view is destroyed before the route animation completes. Done means the table remains in the DOM until the animation finishes, while the reproduction no longer shows immediate removal.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.