react-native-masked-text
react-native-masked-text copied to clipboard
uppercase exists in this library?
How can I have an input with accept only alpha char in upperCase mode, with at least two words? (name and last name)?
Note: I'm using formik and yup, so my onChangeText is like:
onChangeText={formik.handleChange('name')}
Any ideia?
For the uppercase you could do this:
<TextInputMask
options={{
translation: {
A: val => val.toUpperCase()
}
}}
/>
A
convert alpha values to uppercase
Warning: translation sometimes break mask.
mask: "AA"
prevents from typing a non alpha char (as expected), but
mask: "AA",
translation: {
A: val => val.toUpperCase()
}
allows to type numbers
+1
+1
onChangeText={(maskedText, rawText) => {
setValue(rawText?.toUpperCase());
}}
i can set to uppercase in onChangeText