Search code examples
react-nativereact-native-textinput

ReactNative - How to exclude format when using paste on TextInput


React Native : 0.61.4

If paste formatted text into my TextInput, the styles of TextInput are ignored.

 <TextInput
    multiline
    scrollEnabled={false}
    inputAccessoryViewID="reviewButton"
    style={{
      fontSize: 20,
      alignSelf: 'center',
      marginHorizontal: '15%',
      flex: 1,
      textAlignVertical: 'top',
      color: 'black',
    }}
    value={content}
    maxLength={200}
    onChangeText={changeContent}
  />

I specified the color and fontSize in the style of TextInput, but when I use paste, the color and fontSize are different.

How can I remove Text format when pasting?

It only happens on Android.


Solution

  • After doing some research and try to recreate your case in some famous React native app, I think its can't be possible :)

    And btw, in case you haven't notice yet, in Android, there are always two options for pasting including Paste and Paste as plain text.