Open Yupeng-li opened 7 months ago
I cannot seem to reproduce this issue with the snack you've provided. Please check the video attached:
https://github.com/facebook/react-native/assets/1658237/a4d667b4-466c-43a7-8fde-af6d8311d2a4
Could you collect more information on if this is an issue only for specific RN/iOS versions?
I cannot seem to reproduce this issue with the snack you've provided. Please check the video attached:
working_ios.mov Could you collect more information on if this is an issue only for specific RN/iOS versions?
When pasting text in the "TextInput" or selecting a suggestion with length greater than 3
Description
We noticed that sometimes the
onChangeText
event ofTextInput
was fired with text longer thanmaxLength
. According to the doc, this behaviour seems to be unexpected.This happens only on iOS relating to autocompletion.
Steps to reproduce
Here is a snack link to reproduce the issue: https://snack.expo.dev/@yupeng_li/textinput
It contains only a TextInput component and
maxLength
is set to 3. If you type inbef
and let the autocomplete suggestion come up, you will see an alert triggered byonChangeText
when text is longer themaxLength
.In the screenshot below, the text returned is "Before", and the text displayed in the input is "ore".
React Native Version
0.71.14
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/@yupeng_li/textinput
Screenshots and Videos
No response