Closed SrBrahma closed 2 years ago
i have the same problem, i want to disable mask in some cases but i cant. I tried null , undefined even empty string but none of them worked.
:tada: This issue has been resolved in version 0.13.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Thanks, @akinncar!
Steps to reproduce
Expected behaviour
If mask is undefined, the mask/unmask shouldn't be used. If mask is optional, it doesn't make too much sense that it is required to be used.
Actual behaviour
It erases any entered input.
Why I want it? So I can use the MaskedTextInput in the place of TextInput in my new TextInput component, and it would only mask and unmask if mask prop is defined.
I already solved it in a local code, just changed 4 lines in the component, by basically just doing
pattern !== undefined ? unMask(value, type) : value;
etc. I can PR it if wanted.It may feel a little counter intuitive to use a MaskedTextInput and don't use a mask, but it just simplifies custom TextInputs.
react-native-mask-text
Version: 0.7.0