diff --git a/projects/table/src/components/system/table/table.component.ts b/projects/table/src/components/system/table/table.component.ts index c6a1f877e..95e69e866 100644 --- a/projects/table/src/components/system/table/table.component.ts +++ b/projects/table/src/components/system/table/table.component.ts @@ -385,10 +385,16 @@ export class TableComponent implements OnChanges, OnInit, AfterViewInit, OnDe } public processBodyScrollLeftChanges(scrollLeft: number): void { - const scrollableHeaderCells: HTMLElement = this.headerScrollableRowContainerElementRef?.nativeElement; - const scrollableDecorCells: HTMLElement = this.decorScrollableRowContainerElementRef?.nativeElement; - this.renderer.setStyle(scrollableHeaderCells, 'transform', `translateX(${-scrollLeft}px)`); - this.renderer.setStyle(scrollableDecorCells, 'transform', `translateX(${-scrollLeft}px)`); + const scrollableHeaderCells: Nullable = this.headerScrollableRowContainerElementRef?.nativeElement; + const scrollableDecorCells: Nullable = this.decorScrollableRowContainerElementRef?.nativeElement; + + if (!isNil(scrollableHeaderCells)) { + this.renderer.setStyle(scrollableHeaderCells, 'transform', `translateX(${-scrollLeft}px)`); + } + + if (!isNil(scrollableDecorCells)) { + this.renderer.setStyle(scrollableDecorCells, 'transform', `translateX(${-scrollLeft}px)`); + } } public getDndItemIdGetter(rowId: string): () => string {