react-native-cn-richtext-editor icon indicating copy to clipboard operation
react-native-cn-richtext-editor copied to clipboard

SetSpan() ends beyond length

Open babitakapoor112 opened this issue 6 years ago • 9 comments

i am getting this error while removing value from the text input in the rich text editor Screenshot_1569239974 .

babitakapoor112 avatar Sep 23 '19 12:09 babitakapoor112

@babitakapoor112 Which react-native version are you using? I bet this is an instance of those bugs:

  • https://github.com/facebook/react-native/issues/25265
  • https://github.com/facebook/react-native/issues/17236
  • https://github.com/facebook/react-native/issues/18316

RN TextInput component is unfortunately very unreliable and plagued by this bug which has regressed a lot. I noticed however that expo version of react-native is much more stable, and does not have this bug.

jsamr avatar Sep 25 '19 14:09 jsamr

same for me RN 0.60.4

cinatic avatar Sep 25 '19 20:09 cinatic

This error appears when I use PureComponent or shouldComponentUpdate

EremenkoAndrey avatar Nov 04 '19 08:11 EremenkoAndrey

Something broken after 0.60 upgrade on Android. Before 0.60, everything was working as expected on Android, but now when i change selection via inputRef.setNativeProps method during onSelectionChange and if my input text is formatted (with dots for example) it gets crash of setSpan ( x .. x ) beyonds length

edipkavvas avatar Nov 21 '19 11:11 edipkavvas

Did anyone find any solution?

anjananeema1102 avatar Nov 29 '19 07:11 anjananeema1102

I am having the same issue on expo sdk 36

"react-native-cn-richtext-editor": "^2.0.0-rc3",
"expo": "~36.0.0",

samipshah100 avatar Feb 12 '20 06:02 samipshah100

Fixed in https://github.com/facebook/react-native/commit/6ebd3b046e5b71130281f1a7dbe7220eff95d74a; will be shipped in RN 0.62

jsamr avatar Mar 24 '20 12:03 jsamr

"react-native": "0.62.1", "react-native-cn-richtext-editor": "^2.0.0-rc2" issue still exists

thtRajasthaniGuy avatar Apr 08 '20 03:04 thtRajasthaniGuy

How i fix this error:

  1. Go to File CNTextInput.js in library
  2. Remove line selection = {selection} in render Text input

miketrinh1995 avatar May 11 '20 04:05 miketrinh1995