-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Deleting an entire line in a long text inside an input makes scroll to the top on iOS #512
Comments
@ticketapp do you have a big single TextInput (multiline, but with disabled scroll) on the page? Does it makes sense to use the |
@kirillzyusko yes I have a big single TextInput (multiline with disabled scoll) on this page, but I have an other page with other elements of undetermined height where I need a |
@ticketapp in your case the problem happens, because react-native-keyboard-controller/src/components/KeyboardAwareScrollView/index.tsx Line 244 in dce5a57
Since you have a big input which is simultaneously obscured by keyboard and header - whenever you modify the text it will scroll down. A straightforward approach would be to add a new property to A more sophisticated approach would be to track cursor position ( I think temporarily you can |
Thank you very much for your response |
Many thanks @kirillzyusko 🙏🏽 |
#751) ## 📜 Description Added example where input takes full height of the screen. Such scenario is quite common for messaging app (GMail for example). ## 💡 Motivation and Context Will help to reproduce #578 #512 #613 ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### JS - added long `TextInput` to `AwareScrollView` example. ## 🤔 How Has This Been Tested? Tested manually on: - iPhone 15 Pro; - Medium Phone API 35; ## 📸 Screenshots (if appropriate): <img width="274" alt="image" src="https://github.com/user-attachments/assets/d8bc6126-0435-4965-81e1-80edaf13f14f" /> ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
Describe the bug
When I delete an entire line of a long text it makes the scroll view scroll to the top. It happend on Android on 1.11.6 as well but has been fixed between 1.11.6 and the current version (1.12.6)
Code snippet
<KeyboardAwareScrollView> <Input.Area autoFocus scrollEnabled={false} value={editText} minHeight={55} onChangeText={setEditText} /> </KeyboardAwareScrollView>
Expected behavior
The view shouldn't scroll if the line is not hidden
Screenshots
https://github.com/user-attachments/assets/fcf71eba-a64b-46ac-bfc8-bb1db930b522
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: