react-native-masked-text icon indicating copy to clipboard operation
react-native-masked-text copied to clipboard

uppercase exists in this library?

Open alecpo opened this issue 4 years ago • 5 comments

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?

alecpo avatar Mar 26 '20 14:03 alecpo

For the uppercase you could do this:

<TextInputMask 
  options={{ 
    translation: { 
      A: val => val.toUpperCase() 
    } 
  }} 
/>

A convert alpha values to uppercase

fernando-mf avatar May 31 '20 03:05 fernando-mf

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

euZebe avatar Mar 17 '21 12:03 euZebe

+1

MuriloBarranco avatar Apr 19 '22 13:04 MuriloBarranco

+1

AsABarranco avatar Apr 25 '22 17:04 AsABarranco

            onChangeText={(maskedText, rawText) => {
              setValue(rawText?.toUpperCase());
            }}

i can set to uppercase in onChangeText

Marcuspo avatar Jul 15 '22 19:07 Marcuspo