Skip to content

Commit

Permalink
fix(createTextMask): fixes onCompletePattern and onChange calls for n…
Browse files Browse the repository at this point in the history
…on stripped masks

fixes #39
  • Loading branch information
renato-bohler committed May 22, 2018
1 parent bce9ddd commit b9569dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createTextMask.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export default options => {
const formattedValue = format(transformedValue, true);
const newValue = stripMask ? transformedValue : formattedValue;
const hasValueChanged =
transformedValue !== previousValue &&
(transformedValue !== '' || previousValue !== undefined);
newValue !== previousValue &&
(newValue !== '' || previousValue !== undefined);

// We call `onChange` if it was set and if the value actually changed
if (onChange && hasValueChanged) {
Expand Down

0 comments on commit b9569dd

Please sign in to comment.