Skip to content

Commit b3a5022

Browse files
authored
Merge branch 'master' into mkirova/partial-fix-13993
2 parents 1222893 + aeed8fe commit b3a5022

File tree

15 files changed

+102
-102
lines changed

15 files changed

+102
-102
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master, 18.1.x, 17.2.x, 16.1.x, 15.1.x ]
16+
branches: [ master, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master, 18.1.x, 17.2.x, 16.1.x, 15.1.x ]
19+
branches: [ master, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
2020
schedule:
2121
- cron: '33 4 * * 4'
2222

projects/igniteui-angular/src/lib/combo/combo.common.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,11 @@ export abstract class IgxComboBaseDirective implements IgxComboBase, AfterViewCh
179179
return;
180180
}
181181
const selection = this.selectionService.get(this._id);
182+
this.selectionService.clear(this._id);
182183
this._id = value;
183184
if (selection) {
184185
this.selectionService.set(this._id, selection);
185186
}
186-
if (this.dropdown?.open) {
187-
this.dropdown.close();
188-
}
189-
if (this.inputGroup?.isFocused) {
190-
this.inputGroup.element.nativeElement.blur();
191-
this.inputGroup.isFocused = false;
192-
}
193187
}
194188

195189
/**
@@ -1208,15 +1202,15 @@ export abstract class IgxComboBaseDirective implements IgxComboBase, AfterViewCh
12081202
this.searchValue = '';
12091203
if (!e.event) {
12101204
this.comboInput?.nativeElement.focus();
1205+
} else {
1206+
this._onTouchedCallback();
1207+
this.updateValidity();
12111208
}
12121209
}
12131210

12141211
/** @hidden @internal */
12151212
public handleClosed() {
12161213
this.closed.emit({ owner: this });
1217-
if(this.comboInput.nativeElement !== this.document.activeElement){
1218-
this.validateComboState();
1219-
}
12201214
}
12211215

12221216
/** @hidden @internal */
@@ -1256,15 +1250,10 @@ export abstract class IgxComboBaseDirective implements IgxComboBase, AfterViewCh
12561250
public onBlur() {
12571251
if (this.collapsed) {
12581252
this._onTouchedCallback();
1259-
this.validateComboState();
1253+
this.updateValidity();
12601254
}
12611255
}
12621256

1263-
/** @hidden @internal */
1264-
public onFocus(): void {
1265-
this._onTouchedCallback();
1266-
}
1267-
12681257
/** @hidden @internal */
12691258
public setActiveDescendant(): void {
12701259
this.activeDescendant = this.dropdown.focusedItem?.id || '';
@@ -1289,7 +1278,7 @@ export abstract class IgxComboBaseDirective implements IgxComboBase, AfterViewCh
12891278
this.manageRequiredAsterisk();
12901279
};
12911280

1292-
private validateComboState() {
1281+
private updateValidity() {
12931282
if (this.ngControl && this.ngControl.invalid) {
12941283
this.valid = IgxInputState.INVALID;
12951284
} else {

projects/igniteui-angular/src/lib/combo/combo.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
role="combobox" aria-haspopup="listbox"
1414
[attr.aria-expanded]="!dropdown.collapsed" [attr.aria-controls]="dropdown.listId"
1515
[attr.aria-labelledby]="ariaLabelledBy || label?.id || placeholder"
16-
(blur)="onBlur()"
17-
(focus)="onFocus()" />
16+
(blur)="onBlur()" />
1817
<ng-container ngProjectAs="igx-suffix">
1918
<ng-content select="igx-suffix"></ng-content>
2019
</ng-container>

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3615,7 +3615,7 @@ describe('igxCombo', () => {
36153615
combo.open();
36163616
input.triggerEventHandler('focus', {});
36173617
fixture.detectChanges();
3618-
expect(ngModel.touched).toBeTrue();
3618+
expect(ngModel.touched).toBeFalse();
36193619
combo.searchInput.nativeElement.focus();
36203620
fixture.detectChanges();
36213621
const documentClickEvent = new MouseEvent('click', { bubbles: true });

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,9 +2277,6 @@ export abstract class IgxGridBaseDirective implements GridType,
22772277
this._allowFiltering = value;
22782278
this.filteringService.registerSVGIcons();
22792279

2280-
if (!this._init) {
2281-
this.calcGridHeadRow();
2282-
}
22832280

22842281
this.filteringService.isFilterRowVisible = false;
22852282
this.filteringService.filteredColumn = null;
@@ -6859,25 +6856,11 @@ export abstract class IgxGridBaseDirective implements GridType,
68596856
}
68606857
}
68616858

6862-
/**
6863-
* @hidden
6864-
* @internal
6865-
*/
6866-
protected calcGridHeadRow() {
6867-
if (this.maxLevelHeaderDepth) {
6868-
this._baseFontSize = parseFloat(getComputedStyle(this.document.documentElement).getPropertyValue('font-size'));
6869-
const hasFilterRow = this._allowFiltering && this._filterMode === FilterMode.quickFilter;
6870-
const minSize = (this.maxLevelHeaderDepth + 1 + (hasFilterRow ? 1 : 0)) * this.defaultRowHeight / this._baseFontSize;
6871-
this.theadRow.nativeElement.style.minHeight = `${minSize}rem`;
6872-
}
6873-
}
6874-
68756859
/**
68766860
* @hidden
68776861
* Sets TBODY height i.e. this.calcHeight
68786862
*/
68796863
protected calculateGridHeight() {
6880-
this.calcGridHeadRow();
68816864

68826865
this.calcHeight = this._calculateGridBodyHeight();
68836866
if (this.pinnedRowHeight && this.calcHeight) {
@@ -7805,7 +7788,7 @@ export abstract class IgxGridBaseDirective implements GridType,
78057788
} else {
78067789
this._shouldRecalcRowHeight = true;
78077790
}
7808-
}
7791+
}
78097792
}
78107793

78117794
// TODO: About to Move to CRUD

projects/igniteui-angular/src/lib/grids/grid/column-group.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ describe('IgxGrid - multi-column headers #grid', () => {
6767
expect(grid.getColumnByName('ContactName').level).toEqual(expectedLevel);
6868
});
6969

70+
it('should initialize a grid with correct header height', () => {
71+
fixture = TestBed.createComponent(ColumnGroupTestComponent);
72+
fixture.detectChanges();
73+
grid = fixture.componentInstance.grid;
74+
75+
const expectedGridHeaderHeight = 151;
76+
const headerHeight = grid.nativeElement
77+
.querySelector("igx-grid-header-row")
78+
.getBoundingClientRect().height;
79+
80+
expect(Math.round(headerHeight)).toEqual(expectedGridHeaderHeight);
81+
});
82+
7083
it('Should render column group headers correctly.', fakeAsync(() => {
7184
fixture = TestBed.createComponent(BlueWhaleGridComponent);
7285
fixture.detectChanges();

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,6 +2746,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
27462746

27472747
GridFunctions.clickFilterCellChip(fix, 'AnotherField');
27482748
fix.detectChanges();
2749+
grid.cdr.detectChanges();
27492750

27502751
// check if it is positioned at the bottom of the thead.
27512752
const theadWrapper = grid.theadRow.nativeElement.firstElementChild;

projects/igniteui-angular/src/lib/grids/headers/grid-header.component.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ export class IgxGridHeaderComponent implements DoCheck, OnDestroy {
109109
return this.selected;
110110
}
111111

112-
@HostBinding('style.height.rem')
113-
public get height() {
114-
if (!this.grid.hasColumnGroups || this.grid.type === 'pivot') {
115-
return null;
116-
}
117-
118-
return (this.grid.maxLevelHeaderDepth + 1 - this.column.level) * this.grid.defaultRowHeight / this.grid._baseFontSize;
119-
}
120-
121112
/**
122113
* @hidden
123114
*/

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,13 +2106,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
21062106
}
21072107
}
21082108

2109-
/**
2110-
* @hidden
2111-
* @internal
2112-
*/
2113-
protected override calcGridHeadRow() {
2114-
}
2115-
21162109
protected override buildDataView(data: any[]) {
21172110
this._dataView = data;
21182111
}

projects/igniteui-angular/src/lib/navigation-drawer/navigation-drawer.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[class.igx-nav-drawer--disable-animation]="disableAnimation"
1515
(click)="close()" #overlay>
1616
</div>
17-
<aside role="navigation"
17+
<nav
1818
class="igx-nav-drawer__aside"
1919
[class.igx-nav-drawer__aside--collapsed]="!miniTemplate && !isOpen"
2020
[class.igx-nav-drawer__aside--mini]="miniTemplate && !isOpen"
@@ -24,5 +24,5 @@
2424
[class.igx-nav-drawer--disable-animation]="disableAnimation">
2525

2626
<ng-container *ngTemplateOutlet="template || defaultItemsTemplate"></ng-container>
27-
</aside>
27+
</nav>
2828
<div class="igx-nav-drawer__style-dummy" #dummy></div>

0 commit comments

Comments
 (0)