Skip to content

Commit

Permalink
fix(module: textarea-item): fix textarea-item value protect (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuonuoge authored and fisherspy committed Dec 26, 2018
1 parent 59e0ea8 commit e2c0157
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/textarea-item/textarea-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ export class TextareaItem implements OnInit, AfterContentChecked, ControlValueAc
set value(v: string) {
if (typeof v === undefined || v === null) {
this._value = '';
} else {
this._value = v;
}
this._value = v;
this.textRef.nativeElement.value = this._value;
this._onChange(this._value);
}
Expand Down Expand Up @@ -278,8 +279,9 @@ export class TextareaItem implements OnInit, AfterContentChecked, ControlValueAc
writeValue(value: any): void {
if (typeof value === undefined || value === null) {
this._value = '';
} else {
this._value = value;
}
this._value = value;
}
registerOnChange(fn: (_: any) => void): void {
this._onChange = fn;
Expand Down

0 comments on commit e2c0157

Please sign in to comment.