From 484b913d3169b0c863443f3b97cd7b825faee479 Mon Sep 17 00:00:00 2001 From: Stefan Stoyanov Date: Thu, 10 Jan 2019 17:17:04 +0200 Subject: [PATCH] fix(igx-date-picker): Call markForCheck in writeValue method, #3362 # Conflicts: # projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts --- .../src/lib/date-picker/date-picker.component.ts | 7 +++++-- .../lib/grids/filtering/grid-filtering-row.component.ts | 5 ----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts index da2da2d7ca1..1828f06e3ee 100644 --- a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts +++ b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts @@ -16,7 +16,9 @@ import { HostListener, ElementRef, TemplateRef, - Directive + Directive, + isDevMode, + ChangeDetectorRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { @@ -444,7 +446,7 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi @ViewChild(IgxInputDirective) protected input: IgxInputDirective; - constructor(private resolver: ComponentFactoryResolver) { } + constructor(private resolver: ComponentFactoryResolver, private element: ElementRef, private cdr: ChangeDetectorRef) { } /** *Method that sets the selected date. @@ -461,6 +463,7 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi */ public writeValue(value: Date) { this.value = value; + this.cdr.markForCheck(); } /** diff --git a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts index 104fac8a799..b95372ba42a 100644 --- a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts +++ b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts @@ -140,11 +140,6 @@ export class IgxGridFilteringRowComponent implements AfterViewInit { this._conditionsOverlaySettings.outlet = this.column.grid.outletDirective; this._operatorsOverlaySettings.outlet = this.column.grid.outletDirective; - if (this.column.dataType === DataType.Date) { - // TODO: revise usage of cdr.detectChanges() here - this.cdr.detectChanges(); - } - this.input.nativeElement.focus(); }