-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS 14 TextInput jumping and auto-scrolling on tap #30207
Comments
Further information: if I change the render to
the issue is resolved on every phone i have tested EXCEPT the iPhone 11 Pro. (works with iPhone 11 and iPhone 11 Pro Max). The issue on iPhone 11 Pro becomes that one cannot scroll the TextInput beyond the device's height unless I add a height to the TextInput. However, adding a height brings back the initial bug. |
Hi @nfjones87 appreciate the investigation. Definitely odd behavior, what would cause the iPhone 11 Pro to have different behavior? |
Hi @safaiyeh , thanks for commenting. I really don't know what could cause the iPhone 11 Pro to have different behavior. I am simply toggling between different simulators, and it works on all except iPhone 11 pro. For whatever reason the iPhone 11 Pro needs the TextInput to have a set height or else it cannot scroll. However, setting a height produces the bug. To clarify, the bug in the gif above is reproducible on all phones, however it can be fixed on all phones except the iPhone 11 Pro. |
Bump, anyone else experiencing this? |
Sure @nfjones87 😌 |
I'm facing the same issue. I ended up avoiding this behavior by removing the
It still randomly scrolls when I tap the text but at least the cursor is pointed at where it should be so works a little better than setting the height directly, or maybe not. |
hi @nfeignon Have you solved this problem yet? |
Yes, you can see the position cursor but the scroll view cannot automatically scroll |
It's an OS bug, I tried opening the app message from my phone, and it got the same |
hey, @nfjones87 have you fix this yet? i tried several open-source react native app, and try their textinput, and the bug is occured in all of them. |
Tried to rollback to 0.61.5 and problem persists on iOS 14+. Tried to wrap the TextInput ( scrollEnabled=false ) with ScrollView, now I can tap on anywhere to edit, which is good.
|
Experiencing the same issue. Any working workarounds to cover all platforms/versions? @safaiyeh any plans from your side? I feel like this is a major one. |
yes I have tried that, but I got a problem with newline as well, so I can't use that approach |
Experiencing the same, here's an almost duplicate issue: #30748 |
It seems that the react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m Lines 185 to 190 in 896baf7
Tested against iPhone 11 simulator and real iPhone XS. But pressing space and moving up-down it's a bit jerky. Update: Removing completely the above lines seems to improve up-down carret movement, I do not know what side effects this might cause though. |
Awesome! The jumpy behaviours seems to be fixed. However, by removing the line completely it will stay at the current position and won't scroll to the caret position after entering something new at the end of the textInput. Update:
|
Mine is working fine. At least no more users are reporting the same issue. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Do you still experience this issue? I have four years of experience maintaining facebook/react-native and I specialize in the Text and TextInput components. I currently have 58 facebook/react-native PRs. If you still experience this issue, I will prepare a patched release with the fix. Thanks a lot |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
Brand new build, nothing except the code below. Xcode version 12.0.1 iOS 14. RN 0.63.3. scrolling and tapping makes TextInput jump to random places. Happening on iPhone 11 Pro both simulator and device.
React Native version:
System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 973.16 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.3 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps To Reproduce
Simply have a basic TextInput with enough text to produce a vertical scrollbar, then scroll and tap.
Expected Results
The tap should place cursor at tapped position, and not autoscroll the TextInput to the wrong place.
Snack, code example, screenshot, or link to a repository:
The text was updated successfully, but these errors were encountered: