Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 800
oijafoijf asnjksdjn Avatar asked Jul 26 '26 19:07

oijafoijf asnjksdjn


1 Answers

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.

like image 160
Brian H. Avatar answered Jul 29 '26 07:07

Brian H.