Skip to content

Commit

Permalink
fix(module: input-item): fix set value by ngzone.run (NG-ZORRO#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
sWhite01111 authored and fisherspy committed Nov 9, 2018
1 parent 1697cda commit ed2b243
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/input-item/custom-input/custom-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
OnInit,
OnDestroy,
ViewEncapsulation,
HostBinding
HostBinding,
NgZone
} from '@angular/core';
import { CustomInputService } from './custom-input.service';

Expand Down Expand Up @@ -95,7 +96,7 @@ export class CustomInput implements OnInit, OnDestroy {
@HostBinding('class.fake-input-container-left')
clsFakeContainerLeft: boolean;

constructor(private _ref: ElementRef, private _customInputService: CustomInputService) {}
constructor(private _ref: ElementRef, private _customInputService: CustomInputService, private _ngZone: NgZone) {}

onFakeInputClick() {
if (this._preventKeyboard) {
Expand Down Expand Up @@ -228,7 +229,9 @@ export class CustomInput implements OnInit, OnDestroy {
this.onChange.emit(valueAfterChange);
}
}
this._value = valueAfterChange;
this._ngZone.run(() => {
this._value = valueAfterChange;
});
};

ngOnInit() {
Expand Down

0 comments on commit ed2b243

Please sign in to comment.