Skip to content

Commit 45d7f19

Browse files
authored
Merge pull request #12375 from IgniteUI/mkirova/fix-12300-master
fix(igxForOf): Do not update sizes and states while container is deta…
2 parents 5aa1a2c + d8df060 commit 45d7f19

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
893893
}
894894

895895
protected updateSizes() {
896+
if (!this.scrollComponent.nativeElement.isConnected) return;
896897
const scrollable = this.isScrollable();
897898
this.recalcUpdateSizes();
898899
this._applyChanges();

src/app/tabs/tabs.sample.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,5 +282,33 @@ <h3 class="sample-title">Bind selected property</h3>
282282
</igx-tab-item>
283283
</igx-tabs>
284284
</div>
285+
286+
287+
<div >
288+
<h3 class="sample-title">Tab with grid</h3>
289+
<igx-tabs>
290+
<igx-tab-item>
291+
<igx-tab-header>
292+
<igx-icon igxTabHeaderIcon>library_music</igx-icon>
293+
<span igxTabHeaderLabel>Albums</span>
294+
</igx-tab-header>
295+
<igx-tab-content>
296+
<igx-grid #grid1 [data]="localData" [autoGenerate]="true" width="100%" height="100%" >
297+
</igx-grid>
298+
</igx-tab-content>
299+
</igx-tab-item>
300+
<igx-tab-item>
301+
<igx-tab-header>
302+
<igx-icon igxTabHeaderIcon>favorite</igx-icon>
303+
<span igxTabHeaderLabel>Favorite</span>
304+
</igx-tab-header>
305+
<igx-tab-content>
306+
<div style="height: 80vh;">
307+
Test
308+
</div>
309+
</igx-tab-content>
310+
</igx-tab-item>
311+
</igx-tabs>
312+
</div>
285313
</div>
286314
</div>

src/app/tabs/tabs.sample.ts

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,88 @@ export class TabsSampleComponent implements OnInit {
5858
{ ID: 'FRANR', CompanyName: 'France restauration', ContactName: 'Carine Schmitt', ContactTitle: 'Marketing Manager', Address: '54, rue Royale', City: 'Nantes', Region: null, PostalCode: '44000', Country: 'France', Phone: '40.32.21.21', Fax: '40.32.21.20' },
5959
{ ID: 'FRANS', CompanyName: 'Franchi S.p.A.', ContactName: 'Paolo Accorti', ContactTitle: 'Sales Representative', Address: 'Via Monte Bianco 34', City: 'Torino', Region: null, PostalCode: '10100', Country: 'Italy', Phone: '011-4988260', Fax: '011-4988261' }
6060
];
61+
public localData;
62+
public lastYear = new Date().getFullYear() - 1;
63+
public employeesHData = [
64+
{
65+
EmployeeID: '56250fa57ab1535722e564a6',
66+
FirstName: 'Downs',
67+
LastName: 'Holcomb',
68+
Country: 'Italy',
69+
Age: 35,
70+
RegisteredDate2: new Date(this.lastYear, 7, 25),
71+
IsActive2: false,
72+
EmployeeID2: '56250fa57ab1535722e564a6',
73+
FirstName2: 'Downs',
74+
LastName2: 'Holcomb',
75+
Country2: 'Italy',
76+
Age2: 35
77+
},
78+
{
79+
EmployeeID: '56250fa5c0fd04f12555d44d',
80+
FirstName: 'Mckenzie',
81+
LastName: 'Calderon',
82+
Country: 'USA',
83+
Age: 26,
84+
RegisteredDate: new Date(this.lastYear - 1, 9, 22),
85+
IsActive: false,
86+
RegisteredDate2: new Date(this.lastYear, 7, 25),
87+
IsActive2: false,
88+
EmployeeID2: '56250fa57ab1535722e564a6',
89+
FirstName2: 'Downs',
90+
LastName2: 'Holcomb',
91+
Country2: 'Italy',
92+
Age2: 35
93+
94+
},
95+
{
96+
EmployeeID: '56250fa565a7bcc21f6bd15e',
97+
FirstName: 'Howell',
98+
LastName: 'Hawkins',
99+
Country: 'Canada',
100+
Age: 25,
101+
RegisteredDate: new Date(this.lastYear, 8, 8),
102+
IsActive: false,
103+
RegisteredDate2: new Date(this.lastYear, 7, 25),
104+
IsActive2: false,
105+
EmployeeID2: '56250fa57ab1535722e564a6',
106+
FirstName2: 'Downs',
107+
LastName2: 'Holcomb',
108+
Country2: 'Italy',
109+
Age2: 35
110+
},
111+
{
112+
EmployeeID: '56250fa5d71a83c33f3f6479',
113+
FirstName: 'Sheppard',
114+
LastName: 'Nicholson',
115+
Country: 'Italy',
116+
Age: 49,
117+
RegisteredDate: new Date(this.lastYear - 1, 6, 28),
118+
IsActive: false,
119+
RegisteredDate2: new Date(this.lastYear, 7, 25),
120+
IsActive2: false,
121+
EmployeeID2: '56250fa57ab1535722e564a6',
122+
FirstName2: 'Downs',
123+
LastName2: 'Holcomb',
124+
Country2: 'Italy',
125+
Age2: 35
126+
},
127+
{
128+
EmployeeID: '56250fa546abbe8c616d37eb',
129+
FirstName: 'Bettye',
130+
LastName: 'Trujillo',
131+
Country: 'Canada',
132+
Age: 37,
133+
RegisteredDate: new Date(new Date().setDate(-20)),
134+
IsActive: false,
135+
RegisteredDate2: new Date(this.lastYear, 7, 25),
136+
IsActive2: false,
137+
EmployeeID2: '56250fa57ab1535722e564a6',
138+
FirstName2: 'Downs',
139+
LastName2: 'Holcomb',
140+
Country2: 'Italy',
141+
Age2: 35
142+
}];
61143

62144
public contacts: any[] = [{
63145
avatar: 'assets/images/avatar/1.jpg',
@@ -99,6 +181,7 @@ export class TabsSampleComponent implements OnInit {
99181
const tab = 'Tab ' + i;
100182
this.scrollableTabs.push(tab);
101183
}
184+
this.localData = this.employeesHData;
102185
}
103186

104187
public addTab() {

0 commit comments

Comments
 (0)