Skip to content

Commit

Permalink
perf(cdk/table): Short circuit _removeStickyStyle calls against eleme…
Browse files Browse the repository at this point in the history
…nts with no sticky styles (#30471)
  • Loading branch information
kseamon authored Feb 13, 2025
1 parent 48058ff commit 7f9970f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cdk/table/sticky-styler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ export class StickyStyler {
* sticky position if there are no more directions.
*/
_removeStickyStyle(element: HTMLElement, stickyDirections: StickyDirection[]) {
if (!element.classList.contains(this._stickCellCss)) {
return;
}

for (const dir of stickyDirections) {
element.style[dir] = '';
element.classList.remove(this._borderCellCss[dir]);
Expand Down

0 comments on commit 7f9970f

Please sign in to comment.