Skip to content

Commit 925a20f

Browse files
authored
Merge branch '10.2.x' into astaev/issue8388-master
2 parents 0faf17c + 4231dd4 commit 925a20f

26 files changed

+200
-94
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master, 9.1.x, 10.0.x, 10.1.x ]
8+
branches: [ master, '[0-9]+.[0-9]+.x' ]
99
pull_request:
10-
branches: [ master, 9.1.x, 10.0.x, 10.1.x ]
10+
branches: [ master, '[0-9]+.[0-9]+.x' ]
1111

1212
jobs:
1313
build:

angular.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
"with": "src/environments/environment.hmr.ts"
7070
}
7171
]
72+
},
73+
"es5": {
74+
"tsConfig": "src/tsconfig-es5.app.json"
7275
}
7376
}
7477
},
@@ -85,6 +88,11 @@
8588
"hmr": true,
8689
"hmrWarning": false,
8790
"browserTarget": "igniteui-dev-demos:build:hmr"
91+
},
92+
"es5": {
93+
"hmr": true,
94+
"hmrWarning": false,
95+
"browserTarget": "igniteui-dev-demos:build:es5"
8896
}
8997
}
9098
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve --open --configuration hmr",
7+
"start:es5": "ng serve --open --configuration es5",
78
"build": "ng build",
89
"test": "ng test",
910
"lint": "ng lint",

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-action-button.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ng-container *ngIf="!asMenuItem">
22

33
<ng-container *ngIf="!asMenuItem">
4-
<button igxButton="icon" igxRipple (click)="handleClick($event)">
4+
<button igxButton="icon" igxRipple (click)="handleClick($event)" (mousedown)="preventEvent($event)">
55
<igx-icon *ngIf="iconSet" [fontSet]="iconSet" [name]="iconName">{{iconName}}</igx-icon>
66
<igx-icon *ngIf="!iconSet" >{{iconName}}</igx-icon>
77
</button>
@@ -14,4 +14,4 @@
1414
<label *ngIf='asMenuItem' igxLabel>{{labelText}}</label>
1515
</div>
1616
</ng-container>
17-
</ng-container>
17+
</ng-container>

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-action-button.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,14 @@ export class IgxGridActionButtonComponent {
6969
public handleClick(event) {
7070
this.onActionClick.emit(event);
7171
}
72+
73+
/**
74+
* @hidden @internal
75+
*/
76+
public preventEvent(event) {
77+
if (event) {
78+
event.stopPropagation();
79+
event.preventDefault();
80+
}
81+
}
7282
}

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ describe('igxGridEditingActions #grid ', () => {
139139
actionStrip = fixture.componentInstance.actionStrip;
140140
grid = fixture.componentInstance.grid;
141141
}));
142-
it('should auto-show on mouse over of row.', () => {
142+
it('should auto-show on mouse enter of row.', () => {
143143
const row = grid.getRowByIndex(0);
144144
const rowElem = row.nativeElement;
145-
UIInteractions.simulateMouseEvent('mouseover', rowElem, 0, 0);
145+
UIInteractions.simulateMouseEvent('mouseenter', rowElem, 0, 0);
146146
fixture.detectChanges();
147147

148148
expect(actionStrip.context).toBe(row);
@@ -171,18 +171,18 @@ describe('igxGridEditingActions #grid ', () => {
171171
hierarchicalGrid = fixture.componentInstance.hgrid;
172172
}));
173173

174-
it('should auto-show root actionStrip on mouse over of root row.', () => {
174+
it('should auto-show root actionStrip on mouse enter of root row.', () => {
175175
const row = hierarchicalGrid.getRowByIndex(0);
176176
const rowElem = row.nativeElement;
177-
UIInteractions.simulateMouseEvent('mouseover', rowElem, 0, 0);
177+
UIInteractions.simulateMouseEvent('mouseenter', rowElem, 0, 0);
178178
fixture.detectChanges();
179179

180180
expect(actionStripRoot.context).toBe(row);
181181
expect(actionStripRoot.hidden).toBeFalse();
182182
expect(actionStripChild.context).toBeUndefined();
183183
});
184184

185-
it('should auto-show row island actionStrip on mouse over of child row.', () => {
185+
it('should auto-show row island actionStrip on mouse enter of child row.', () => {
186186
const row = hierarchicalGrid.getRowByIndex(0) as IgxHierarchicalRowComponent;
187187
row.toggle();
188188
fixture.detectChanges();
@@ -191,7 +191,7 @@ describe('igxGridEditingActions #grid ', () => {
191191

192192
const childRow = childGrid.getRowByIndex(0);
193193
const rowElem = childRow.nativeElement;
194-
UIInteractions.simulateMouseEvent('mouseover', rowElem, 0, 0);
194+
UIInteractions.simulateMouseEvent('mouseenter', rowElem, 0, 0);
195195
fixture.detectChanges();
196196

197197
expect(actionStripChild.context).toBe(childRow);

projects/igniteui-angular/src/lib/core/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export const NAVIGATION_KEYS = new Set([
328328
]);
329329
export const ROW_EXPAND_KEYS = new Set('right down arrowright arrowdown'.split(' '));
330330
export const ROW_COLLAPSE_KEYS = new Set('left up arrowleft arrowup'.split(' '));
331-
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup', '+']);
331+
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup', '+', 'add']);
332332
export const HEADER_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'escape', 'esc' , 'l']);
333333

334334
/**

projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
426426
private _moduleRef: NgModuleRef<any>,
427427
private _injector: Injector,
428428
private _renderer: Renderer2) {
429-
}
429+
}
430430

431431

432432
/**
@@ -827,7 +827,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
827827
return this._inputGroup || this._inputGroupUserTemplate || null;
828828
}
829829

830-
/** @hidden @internal */
830+
/** @hidden @internal */
831831
public get inputDirective(): IgxInputDirective {
832832
return this._inputDirective || this._inputDirectiveUserTemplates.first || null;
833833
}
@@ -922,7 +922,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
922922

923923
this._inputDirectiveUserTemplates.changes.subscribe(() => {
924924
this.attachTemplateBlur();
925-
});
925+
});
926926
this.attachTemplateBlur();
927927
}
928928

@@ -938,8 +938,8 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
938938
this.rawDateString = (res.target as HTMLInputElement).value;
939939
this.onBlur(res, false);
940940
});
941-
// TODO: Refactor custom template handling.
942-
// Revise blur handling when custom template is passed
941+
// TODO: Refactor custom template handling.
942+
// Revise blur handling when custom template is passed
943943
}
944944
}
945945

@@ -1178,6 +1178,12 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
11781178

11791179
/** @hidden @internal */
11801180
public onInput(event) {
1181+
/**
1182+
* Fix for #8165 until refactoring (#6483).
1183+
* The IgxDateTimeEditor will be used to handle all inputs, i.e. this handler will be removed.
1184+
* It extends the IgxMaskDirective which contains logic that handles this issue.
1185+
*/
1186+
if (isIE() && !this._isInEditMode && !this.inputGroup.isFocused) { return; }
11811187
const targetValue = event.target.value;
11821188
const cursorPosition = this._getCursorPosition();
11831189
const checkInput = DatePickerUtil.checkForCompleteDateInput(this.dateFormatParts, targetValue);

projects/igniteui-angular/src/lib/directives/mask/mask.directive.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
154154
/** @hidden */
155155
public ngOnInit(): void {
156156
if (!this.nativeElement.placeholder) {
157-
this.renderer.setAttribute(this.nativeElement, 'placeholder', this.maskOptions.format);
157+
this.renderer.setAttribute(this.nativeElement, 'placeholder', this.maskOptions.format);
158158
}
159159
}
160160

@@ -188,7 +188,15 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
188188
/** @hidden */
189189
@HostListener('input')
190190
public onInputChanged(): void {
191-
if (isIE() && this._stopPropagation) {
191+
/**
192+
* '!this._focused' is a fix for #8165
193+
* On page load IE triggers input events before focus events and
194+
* it does so for every single input on the page.
195+
* The mask needs to be prevented from doing anything while this is happening because
196+
* the end user will be unable to blur the input.
197+
* https://stackoverflow.com/questions/21406138/input-event-triggered-on-internet-explorer-when-placeholder-changed
198+
*/
199+
if (isIE() && (this._stopPropagation || !this._focused)) {
192200
this._stopPropagation = false;
193201
return;
194202
}

projects/igniteui-angular/src/lib/grids/api.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
471471

472472
public get_all_data(includeTransactions = false): any[] {
473473
const grid = this.grid;
474-
let data = grid.data ? grid.data : [];
474+
let data = grid && grid.data ? grid.data : [];
475475
data = includeTransactions ? grid.dataWithAddedInTransactionRows : data;
476476
return data;
477477
}

0 commit comments

Comments
 (0)