99 ChangeDetectorRef ,
1010 Component ,
1111 ContentChild ,
12+ ElementRef ,
1213 EventEmitter ,
1314 Injector ,
1415 Input ,
@@ -20,7 +21,7 @@ import {
2021 ViewContainerRef ,
2122} from '@angular/core' ;
2223import { Subscription } from 'rxjs' ;
23- import { debounceTime , tap } from 'rxjs/operators' ;
24+ import { debounceTime , skipWhile , tap } from 'rxjs/operators' ;
2425
2526import { ClrPopoverEventsService , ClrPopoverPositionService } from '../../utils' ;
2627import { HostWrapper } from '../../utils/host-wrapping/host-wrapper' ;
@@ -153,7 +154,8 @@ export class ClrDatagridColumn<T = any>
153154 private detailService : DetailService ,
154155 private changeDetectorRef : ChangeDetectorRef ,
155156 private smartPositionService : ClrPopoverPositionService ,
156- private smartEventsService : ClrPopoverEventsService
157+ private smartEventsService : ClrPopoverEventsService ,
158+ private elementRef : ElementRef
157159 ) {
158160 super ( filters ) ;
159161 this . subscriptions . push ( this . listenForSortingChanges ( ) ) ;
@@ -311,6 +313,10 @@ export class ClrDatagridColumn<T = any>
311313 return this . wrappedInjector . get ( WrappedColumn , this . vcr ) . columnView ;
312314 }
313315
316+ get datagridElementRef ( ) {
317+ return this . elementRef ?. nativeElement ?. closest ( 'clr-datagrid' ) ;
318+ }
319+
314320 ngOnInit ( ) {
315321 this . wrappedInjector = new HostWrapper ( WrappedColumn , this . vcr ) ;
316322 }
@@ -381,6 +387,7 @@ export class ClrDatagridColumn<T = any>
381387 private listenForFilterChanges ( ) {
382388 return this . filter . changes
383389 . pipe (
390+ skipWhile ( ( ) => ! ! this . datagridElementRef ?. style . height === true ) ,
384391 tap ( ( ) => {
385392 this . smartEventsService . removeScrollListener ( ) ;
386393 this . smartPositionService . realign ( ) ;
0 commit comments