Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call markForCheck in writeValue method #3572

Merged
merged 8 commits into from
Jan 15, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
HostListener,
ElementRef,
TemplateRef,
Directive
Directive,
ChangeDetectorRef
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import {
Expand Down Expand Up @@ -444,7 +445,7 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi

@ViewChild(IgxInputDirective) protected input: IgxInputDirective;

constructor(private resolver: ComponentFactoryResolver) { }
constructor(private resolver: ComponentFactoryResolver, private cdr: ChangeDetectorRef) { }

/**
*Method that sets the selected date.
Expand All @@ -461,6 +462,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 @@ -142,11 +142,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