Skip to content

Commit 8b92fda

Browse files
committedApr 2, 2024·
fix(material/sort): clear aria description on destroy (#28801)
Fixes that the sort header wasn't clearing its ARIA description when it gets destroyed, causing a memory leak. (cherry picked from commit ced93a9)
1 parent 6b5b0c5 commit 8b92fda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/material/sort/sort-header.ts

+4
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ export class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewI
230230
this._focusMonitor.stopMonitoring(this._elementRef);
231231
this._sort.deregister(this);
232232
this._rerenderSubscription.unsubscribe();
233+
234+
if (this._sortButton) {
235+
this._ariaDescriber?.removeDescription(this._sortButton, this._sortActionDescription);
236+
}
233237
}
234238

235239
/**

0 commit comments

Comments
 (0)
Please sign in to comment.