Skip to content

Commit

Permalink
Merge pull request #1511 from mertsincan/master
Browse files Browse the repository at this point in the history
Default value is not masked by InputMask
  • Loading branch information
cagataycivici committed Dec 20, 2016
2 parents c08646e + f992187 commit eb6f983
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions components/inputmask/inputmask.ts
Expand Up @@ -172,13 +172,22 @@ export class InputMask implements AfterViewInit,OnDestroy,ControlValueAccessor {
}

writeValue(value: any) : void {
var _this = this;
this.value = value;

if(this.input) {
if(this.value == undefined || this.value == null) {
if(this.value == undefined || this.value == null || this.len == this.value.length) {
this.input.value = '';
}
this.checkVal();
else {
this.input.value = this.value;
this.checkVal();
}

setTimeout(() => {
_this.writeBuffer();
_this.checkVal();
}, 10);
}

this.updateFilledState();
Expand Down

0 comments on commit eb6f983

Please sign in to comment.