We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got issue when pass falsy value to TextInput with money type:
<TextInputMask type="money" options={{ precision: 0, separator: ' ', delimiter: ' ', unit: '', suffixUnit: '', }} value={null} placeholder="Test" onChangeText={() => {}} />
So here instead of placeholder I got 0. Here is sand
I dive deep into code:
https://github.com/benhurott/react-native-masked-text/blob/0b04ce41087b5e97c5f13f114bdb513c6e107eb3/lib/masks/money.mask.js#L29
We will get 0 when we will pass empty string
So I think it should be some check for empty string before pass value to mask, maybe here: https://github.com/benhurott/react-native-masked-text/blob/0b04ce41087b5e97c5f13f114bdb513c6e107eb3/lib/base-text-component.js#L76-L80
Something like this:
_getMaskedValue(value) { if (this._getDefaultValue(value) === '') { return '' } return this._maskHandler.getValue( this._getDefaultValue(value), this._getOptions()); }
I can make PR, if it is right place to do this kind of check
The text was updated successfully, but these errors were encountered:
8e31ff3
@benhurott thanks for quick fix!
Sorry, something went wrong.
No branches or pull requests
I got issue when pass falsy value to TextInput with money type:
So here instead of placeholder I got 0.
Here is sand
I dive deep into code:
https://github.com/benhurott/react-native-masked-text/blob/0b04ce41087b5e97c5f13f114bdb513c6e107eb3/lib/masks/money.mask.js#L29
We will get 0 when we will pass empty string
So I think it should be some check for empty string before pass value to mask, maybe here:
https://github.com/benhurott/react-native-masked-text/blob/0b04ce41087b5e97c5f13f114bdb513c6e107eb3/lib/base-text-component.js#L76-L80
Something like this:
I can make PR, if it is right place to do this kind of check
The text was updated successfully, but these errors were encountered: