Skip to content

Commit cd677bf

Browse files
authored
Merge branch 'master' into ganastasov/fix-14151-master
2 parents bb70d73 + 933d440 commit cd677bf

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
9090
@Input()
9191
public set minValue(value: string | Date) {
9292
this._minValue = value;
93-
this.onValidatorChange();
93+
this._onValidatorChange();
9494
}
9595

9696
/**
@@ -111,7 +111,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
111111
@Input()
112112
public set maxValue(value: string | Date) {
113113
this._maxValue = value;
114-
this.onValidatorChange();
114+
this._onValidatorChange();
115115
}
116116

117117
/**
@@ -216,7 +216,6 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
216216
private _dateValue: Date;
217217
private _onClear: boolean;
218218
private document: Document;
219-
private _isFocused: boolean;
220219
private _defaultInputFormat: string;
221220
private _value: Date | string;
222221
private _minValue: Date | string;
@@ -230,9 +229,9 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
230229
minutes: 1,
231230
seconds: 1
232231
};
233-
private onTouchCallback: (...args: any[]) => void = noop;
232+
234233
private onChangeCallback: (...args: any[]) => void = noop;
235-
private onValidatorChange: (...args: any[]) => void = noop;
234+
private _onValidatorChange: (...args: any[]) => void = noop;
236235

237236
private get datePartDeltas(): DatePartDeltas {
238237
return Object.assign({}, this._datePartDeltas, this.spinDelta);
@@ -289,7 +288,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
289288

290289
@HostListener('wheel', ['$event'])
291290
public onWheel(event: WheelEvent): void {
292-
if (!this._isFocused) {
291+
if (!this._focused) {
293292
return;
294293
}
295294
event.preventDefault();
@@ -392,7 +391,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
392391

393392
/** @hidden @internal */
394393
public registerOnValidatorChange?(fn: () => void): void {
395-
this.onValidatorChange = fn;
394+
this._onValidatorChange = fn;
396395
}
397396

398397
/** @hidden @internal */
@@ -402,7 +401,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
402401

403402
/** @hidden @internal */
404403
public override registerOnTouched(fn: any): void {
405-
this.onTouchCallback = fn;
404+
this._onTouchedCallback = fn;
406405
}
407406

408407
/** @hidden @internal */
@@ -471,16 +470,16 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
471470
if (this.nativeElement.readOnly) {
472471
return;
473472
}
474-
this._isFocused = true;
475-
this.onTouchCallback();
473+
this._focused = true;
474+
this._onTouchedCallback();
476475
this.updateMask();
477476
super.onFocus();
478477
this.nativeElement.select();
479478
}
480479

481480
/** @hidden @internal */
482481
public override onBlur(value: string): void {
483-
this._isFocused = false;
482+
this._focused = false;
484483
if (!this.inputIsComplete() && this.inputValue !== this.emptyMask) {
485484
this.updateValue(this.parseDate(this.inputValue));
486485
} else {
@@ -504,7 +503,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
504503
}
505504

506505
private updateMask(): void {
507-
if (this._isFocused) {
506+
if (this._focused) {
508507
// store the cursor position as it will be moved during masking
509508
const cursor = this.selectionEnd;
510509
this.inputValue = this.getMaskedValue();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,21 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
130130

131131
protected _composing: boolean;
132132
protected _compositionStartIndex: number;
133+
protected _focused = false;
133134
private _compositionValue: string;
134135
private _end = 0;
135136
private _start = 0;
136137
private _key: string;
137138
private _mask: string;
138139
private _oldText = '';
139140
private _dataValue = '';
140-
private _focused = false;
141141
private _droppedData: string;
142142
private _hasDropAction: boolean;
143143

144144
private readonly defaultMask = 'CCCCCCCCCC';
145145

146-
private _onTouchedCallback: () => void = noop;
147-
private _onChangeCallback: (_: any) => void = noop;
146+
protected _onTouchedCallback: () => void = noop;
147+
protected _onChangeCallback: (_: any) => void = noop;
148148

149149
constructor(
150150
protected elementRef: ElementRef<HTMLInputElement>,

0 commit comments

Comments
 (0)