diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a079662..a8f9b743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## Unreleased +## [1.12.4] - 2019-07-12 + +### Fix + +- [#170](https://github.com/benhurott/react-native-masked-text/issues/170): fixing typing for includeRawValueInChangeText. + - thanks to [Sergei Butko](https://github.com/svbutko) for contribution. + - thanks to [Agustin G.](https://github.com/agustingabiola) for reporting. +- [#173](https://github.com/benhurott/react-native-masked-text/issues/173): fixing initial value for money field. + - thanks to [Maksim Markelov](https://github.com/mmarkelov) for reporting. + ## [1.12.3] - 2019-05-17 ### Fix diff --git a/dist/lib/base-text-component.js b/dist/lib/base-text-component.js index b5094711..6334ef5f 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 boolean getRawValue?: (value: string, settings: TextInputMaskOptionProp) => any translation?: { [s: string]: (val: string) => string | null | undefined } - - // Options - includeRawValueInChangeText?: boolean } // TextInputMask Props @@ -62,6 +59,7 @@ export interface TextInputMaskProps extends Pick void customTextInput?: any customTextInputProps?: Object + includeRawValueInChangeText?: boolean } // TextInputMask Component diff --git a/lib/base-text-component.js b/lib/base-text-component.js index a9a8a467..cd87314b 100644 --- a/lib/base-text-component.js +++ b/lib/base-text-component.js @@ -74,8 +74,13 @@ export default class BaseTextComponent extends PureComponent { } _getMaskedValue(value) { + const defaultValue = this._getDefaultValue(value) + if (defaultValue === '') { + return '' + } + return this._maskHandler.getValue( - this._getDefaultValue(value), + defaultValue, this._getOptions()); } diff --git a/package.json b/package.json index 1060d91f..33f1b690 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-masked-text", - "version": "1.12.3", + "version": "1.12.4", "description": "Text and TextInput with mask for React Native applications", "licenses": [ {