Skip to content

Commit 7f9970f

Browse files
authored
perf(cdk/table): Short circuit _removeStickyStyle calls against elements with no sticky styles (#30471)
1 parent 48058ff commit 7f9970f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cdk/table/sticky-styler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ export class StickyStyler {
329329
* sticky position if there are no more directions.
330330
*/
331331
_removeStickyStyle(element: HTMLElement, stickyDirections: StickyDirection[]) {
332+
if (!element.classList.contains(this._stickCellCss)) {
333+
return;
334+
}
335+
332336
for (const dir of stickyDirections) {
333337
element.style[dir] = '';
334338
element.classList.remove(this._borderCellCss[dir]);

0 commit comments

Comments
 (0)