Skip to content

Commit

Permalink
Let me in franciss (text-mask#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
Svenergy authored and lozjackson committed Apr 23, 2018
1 parent 21ee3ac commit 47735fc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions angular2/src/angular2TextMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export class MaskedInputDirective implements ControlValueAccessor, OnChanges {
private textMaskInputElement: any
private inputElement: HTMLInputElement

// stores the last value for comparison
private lastValue: any

@Input('textMask')
textMaskConfig = {
mask: [],
Expand Down Expand Up @@ -73,12 +70,7 @@ export class MaskedInputDirective implements ControlValueAccessor, OnChanges {

// get the updated value
value = this.inputElement.value

// check against the last value to prevent firing ngModelChange despite no changes
if (this.lastValue !== value) {
this.lastValue = value
this._onChange(value)
}
this._onChange(value)
}
}

Expand Down

0 comments on commit 47735fc

Please sign in to comment.