Skip to content

Commit

Permalink
Merge pull request #3571 from IgniteUI/sstoyanov/bug-fix-3362
Browse files Browse the repository at this point in the history
Call markForCheck in writeValue method
  • Loading branch information
rkaraivanov authored Jan 14, 2019
2 parents 2d1a63c + 0997a73 commit fa9379b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
ElementRef,
TemplateRef,
Directive,
isDevMode
isDevMode,
ChangeDetectorRef
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import {
Expand Down Expand Up @@ -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.
Expand All @@ -462,6 +463,7 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi
*/
public writeValue(value: Date) {
this.value = value;
this.cdr.markForCheck();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit fa9379b

Please sign in to comment.