File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/cdk-experimental/column-resize Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ import {
1818 Type ,
1919 ViewContainerRef ,
2020 ChangeDetectorRef ,
21+ afterNextRender ,
22+ runInInjectionContext
2123} from '@angular/core' ;
2224import { Directionality } from '@angular/cdk/bidi' ;
2325import { ComponentPortal } from '@angular/cdk/portal' ;
@@ -284,9 +286,13 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
284286 }
285287
286288 private _updateOverlayHandleHeight ( ) {
287- requestAnimationFrame ( ( ) => {
288- this . overlayRef ! . updateSize ( { height : this . elementRef . nativeElement ! . offsetHeight } ) ;
289- } )
289+ runInInjectionContext ( this . injector , ( ) => {
290+ afterNextRender ( {
291+ write : ( ) => {
292+ this . overlayRef ! . updateSize ( { height : this . elementRef . nativeElement ! . offsetHeight } ) ;
293+ }
294+ } ) ;
295+ } ) ;
290296 }
291297
292298 private _applySize ( sizeInPixels : number , previousSize ?: number ) : void {
You can’t perform that action at this time.
0 commit comments