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

rawText equal to text when type=custom

Open aibars opened this issue 5 years ago • 1 comments

Hello,

After logging the text and rawText of a custom type masked input, I noticed that the raw text is equal to the text.

aibars avatar Feb 11 '20 02:02 aibars

You need to provide your own raw value resolver when using custom type:

<TextInputMask 
  type='custom'
  options={{
    mask: '(999) 999-9999',
    getRawValue: value => value.replace(/[()\s-]/g, '')
  }}
/>

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