From e6426262c0457531b40f0f9be2329c43c9323dc9 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 --- .../src/lib/date-picker/date-picker.component.ts | 6 ++++-- .../src/lib/grids/filtering/grid-filtering-row.component.ts | 5 ----- 2 files changed, 4 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 98319bc0590..03f0063d782 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 @@ -17,7 +17,8 @@ import { ElementRef, TemplateRef, Directive, - isDevMode + isDevMode, + ChangeDetectorRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { @@ -445,7 +446,7 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi @ViewChild(IgxInputDirective) protected input: IgxInputDirective; - constructor(private resolver: ComponentFactoryResolver, private element: ElementRef) { } + constructor(private resolver: ComponentFactoryResolver, private element: ElementRef, private cdr: ChangeDetectorRef) { } /** *Method that sets the selected date. @@ -462,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 e58ed1495ca..c9c9482f630 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 @@ -141,11 +141,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(); }