react-native-masked-text
react-native-masked-text copied to clipboard
Set Max and Min amount for the money input
Hi @benhurott currently there are no ways to limit the user from entering the input in this masked library. What I'm trying to achieve is that the user are not allowed to key in an amount that is more than x amount.
Is there a way to hold the library from updating the front end input field if the amount that exceeding the limit set? Please provide example code snippet.
Thanks
This is actually doable with the checkText function.
You can write a custom function to check the text, and return true if you want to accept it. For example:
checkText={(previous, next) => {
return next.length <= 7;
}}