Skip to content

Commit 2bd3220

Browse files
committed
perf(cdk-experimental/column-resize): improve hover responsiveness of column resize with requestAnimationFrame
Improve column resize performance when calling the `_updateOverlayHandleHeight()` method in the `cdk-experimental` column resize feature. By wrapping the `updateSize` call inside a `requestAnimationFrame()`, the height update is deferred to the next repaint, improving responsiveness during hover interactions.
1 parent ba5cf3d commit 2bd3220

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cdk-experimental/column-resize/resizable.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,9 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
284284
}
285285

286286
private _updateOverlayHandleHeight() {
287-
this.overlayRef!.updateSize({height: this.elementRef.nativeElement!.offsetHeight});
287+
requestAnimationFrame(() => {
288+
this.overlayRef!.updateSize({height: this.elementRef.nativeElement!.offsetHeight});
289+
})
288290
}
289291

290292
private _applySize(sizeInPixels: number, previousSize?: number): void {

0 commit comments

Comments
 (0)