Skip to content

Commit 5c5dec4

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Minor fixes.
1 parent eebb969 commit 5c5dec4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
11511151
const count = this.isRemote ? this.totalItemCount : items.length;
11521152
for (i; i < count; i++) {
11531153
size = this._getItemSize(items[i], dimension);
1154-
if (dimension === 'height') {
1154+
if (this.igxForScrollOrientation === 'vertical') {
11551155
this.heightCache.push(size);
11561156
}
11571157
totalSize += size;
@@ -1405,7 +1405,7 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
14051405
}
14061406

14071407
private _getItemSize(item, dimension: string): number {
1408-
const dim = item[dimension];
1408+
const dim = item ? item[dimension] : null;
14091409
return typeof dim === 'number' ? dim : parseInt(this.igxForItemSize, 10) || 0;
14101410
}
14111411

@@ -1478,7 +1478,7 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
14781478
}
14791479

14801480
protected get itemsDimension() {
1481-
return this.igxForScrollOrientation === 'horizontal' ? this.igxForSizePropName : 'height';
1481+
return this.igxForSizePropName || 'height';
14821482
}
14831483

14841484
/**

0 commit comments

Comments
 (0)