Closed thatjuan closed 5 years ago
Even i am facing the same issue and its only for IOS.
Which version of RN? >= 0.54?
Dupe of this? https://github.com/jwohlfert23/react-native-tag-input/issues/55
0.55 on iOS.
There is a bug in recent versions of RN where Backspace gets called incorrectly when the TextInput is cleared, so it doesn't return in the 'if' check below and then gets pop'd. And I think another bug where the value wasn't getting set right.
if (this.props.text !== '' || event.nativeEvent.key !== 'Backspace') {
return;
}
const tags = [...this.props.value];
tags.pop();
There are PR's up that fix it, but who knows when it'll make it out to release. Have a branch off of 0.55.4 with the 2 patches applied that fixed the issues for me, if useful to anyone.
https://github.com/nol13/react-native/tree/TextInput-Patch-0.55.4
Thanks for researching this bug @nol13! It looks like there are two issues, yeah?
Ya two issues, need both patches to get normal behavior. Not really sure of/qualified to speak about the relative merit of 19087 vs. 18456, as far as I can tell both work, just need one or the other.
The backspace patch is needed to fix the issue where you can only add one tag. The other fixes a bunch of weird behavior where the js and native values can get out of sync or something after adding a few tags, and events stop firing, backspace will delete tags even if there is still text, etc.
@nol13 any workaround for expo users?
i think downgrading to expo 25 would do it, if that's a possibility.
(and saw backspace fix merged, thanks for moving that along!)
Edit: is fixed in 0.57 in case anyone comes across this still
Expo 25 is deprecated. Still getting this issue in the latest version of expo.
I've set up a TagInput pretty similar to the way it's set up in the example. When I type a new tag, the previous tag gets removed.
I suspect it's because of this line: https://github.com/jwohlfert23/react-native-tag-input/blob/90e8a50d187a807b58ff3454eb25ce31c478b78f/index.js#L219
What's the purpose of this line?