Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,19 @@ describe('IgxForOf directive -', () => {
}
});

it('should not throw error when itemSize is changed while data is null/undefined.', () => {
let errorMessage = '';
fix.componentInstance.data = null;
fix.detectChanges();
try {
fix.componentInstance.itemSize = '100px';
fix.detectChanges();
} catch (ex) {
errorMessage = ex.message;
}
expect(errorMessage).toBe('');
});

it('should allow initially undefined value for igxForOf and then detect changes correctly once the value is updated', async () => {
fix = TestBed.createComponent(VerticalVirtualNoDataComponent);
expect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
}
}
const defaultItemSize = 'igxForItemSize';
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange && this.igxForScrollOrientation === 'vertical') {
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange &&
this.igxForScrollOrientation === 'vertical' && this.igxForOf) {
// handle default item size changed.
this.initSizesCache(this.igxForOf);
this._applyChanges();
Expand Down Expand Up @@ -1325,7 +1326,8 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
}
}
const defaultItemSize = 'igxForItemSize';
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange && this.igxForScrollOrientation === 'vertical') {
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange &&
this.igxForScrollOrientation === 'vertical' && this.igxForOf) {
// handle default item size changed.
this.initSizesCache(this.igxForOf);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<button (click)='setterBindingChange()'>Set rowSelectable via binding</button>
<button (click)='setterChange()'>Set rowSelectable via setter on 1st row island</button>
<igx-hierarchical-grid #grid1 [data]="remoteData" [primaryKey]="'CustomerID'" [autoGenerate]="false" [height]="'800px'" [width]="'100%'" #hGrid [emptyGridMessage]="''">
<igx-hierarchical-grid #grid1 displayDensity="cosy" [data]="remoteData" [primaryKey]="'CustomerID'" [autoGenerate]="false" [height]="'800px'" [width]="'100%'" #hGrid [emptyGridMessage]="''">
<igx-column field="CustomerID"></igx-column>
<igx-column field="CompanyName"></igx-column>
<igx-column field="ContactName"></igx-column>
Expand Down