Skip to content

Commit 5b3dd8f

Browse files
chintankavathiatimowolf
authored andcommitted
fix: calculate column widths only when table is visible
1 parent 2cd9f1f commit 5b3dd8f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

projects/ngx-datatable/src/lib/components/datatable.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,11 +898,10 @@ export class DatatableComponent<TRow = any>
898898
forceIdx: number = -1,
899899
allowBleed: boolean = this.scrollbarH
900900
): TableColumn[] | undefined {
901-
if (!columns) {
901+
let width = this._innerWidth;
902+
if (!columns || !width) {
902903
return undefined;
903904
}
904-
905-
let width = this._innerWidth;
906905
const bodyElement = this.bodyElement?.nativeElement;
907906
this.verticalScrollVisible = bodyElement?.scrollHeight > bodyElement?.clientHeight;
908907
if (this.scrollbarV && !this.scrollbarVDynamic) {

0 commit comments

Comments
 (0)