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 #3571

Merged
merged 4 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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