Skip to content

Commit

Permalink
Maps undefined / null to empty strings. Similar to angular2 issue (te…
Browse files Browse the repository at this point in the history
…xt-mask#4… (text-mask#711)

* Maps undefined / null to empty strings. Similar to angular2 issue (text-mask#435).

* Need this to run the branch via npm in the interim.
  • Loading branch information
adamjhickey authored and lozjackson committed Apr 29, 2018
1 parent 9236e63 commit 7b7fd2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion angular1/dist/angular1TextMask.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions angular1/src/angular1TextMask.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ function textMask() {

function formatter(fromModelValue) {
// set the `inputElement.value` for cases where the `mask` is disabled
inputElement.value = fromModelValue
var normalizedValue = fromModelValue == null ? '' : fromModelValue
inputElement.value = normalizedValue

textMaskInputElement.update(fromModelValue)
textMaskInputElement.update(normalizedValue)
return inputElement.value
}

Expand Down

0 comments on commit 7b7fd2e

Please sign in to comment.