diff --git a/CHANGELOG.md b/CHANGELOG.md index 469bbaeb..6a079662 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +## [1.12.3] - 2019-05-17 + +### Fix + +- Fixing [#162](https://github.com/benhurott/react-native-masked-text/issues/162) initial value when mask is updated. (thanks to [Alessandro Sales](https://github.com/alessandrosales) for reporting) + ## [1.12.2] - 2019-04-22 ### Refactor diff --git a/dist/lib/base-text-component.js b/dist/lib/base-text-component.js index df300f06..b5094711 100644 --- a/dist/lib/base-text-component.js +++ b/dist/lib/base-text-component.js @@ -1 +1 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i this._onChangeText(text)} - value={this.props.value} + value={ + this.getDisplayValueFor( + this.props.value + ) + } /> ) } diff --git a/lib/text-mask.js b/lib/text-mask.js index e794484e..08041f8b 100644 --- a/lib/text-mask.js +++ b/lib/text-mask.js @@ -17,7 +17,11 @@ export default class TextMask extends BaseTextComponent { render() { return ( - {this.props.value} + { + this.getDisplayValueFor( + this.props.value + ) + } ); } } diff --git a/package.json b/package.json index 3060d7f4..1060d91f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-masked-text", - "version": "1.12.2", + "version": "1.12.3", "description": "Text and TextInput with mask for React Native applications", "licenses": [ {