-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
KeyboardAwareScrollView scrolling too much when pasting a lot of content in multiline inputibox #348
Comments
@domenicoprestia maybe double scroll happens because of "simultaneous" layout & text-change handlers? Would you mind to try to remove this code: useAnimatedReaction(
() => input.value,
(current, previous) => {
if (
current?.target === previous?.target &&
current?.layout.height !== previous?.layout.height
) {
const prevLayout = layout.value;
layout.value = input.value;
scrollPosition.value += maybeScroll(keyboardHeight.value, true);
layout.value = prevLayout;
}
},
[],
); And see whether it fixes the problem? |
yes i'll try instantly, in which file can i find it? |
i've just tried and without that chunk of code it does not scroll when pasting |
@domenicoprestia doesn't scroll at all or doesn't scroll too much (i. e. expected/desired behavior)? 😅 |
when i remove it it does not scroll at all, sorry for not being too specific 😅 |
I've tried to reproduce the problem in example app, but no luck - maybe you can provide a code snippet with minimal reproduction example?
|
Sorry, just saw this comment, i'll try to reproduce it again and to give you more background informations on this |
@domenicoprestia may I ask you which Android version were you using in your tests? |
@domenicoprestia it could be fixed in latest |
@kirillzyusko I am facing a different scroll issue, when text is long and paste on TextInput the scroll won't scroll down, it starts scrolling when you try to scroll couple of time after a fraction of time. Also when we scroll the text manually and try to retype the offset is broken which means the TextInput scrolls up way too much when type. I am using the latest 1.12.4. |
@iphonic can you provide a minimal reproduction example, please? 🙏 |
@kirillzyusko Yes I am doing this
Attached a recording of what's happening, it doesn't allow to scroll up or down, need to do it multiple times. RPReplay_Final1719336468.mp4 |
@iphonic can you try to replace On my simulator the problem with scrolling remains - if you scroll outside of the input you can scroll, if you scroll within an input -> it doesn't scroll and it's expected 🤷♂️ |
I strongly believe that the issue was fixed in 21eff3b and I'm closing the issue. If you discover that the problem still remains, feel free to open a new issue or leave a comment here and I'll re-open the issue. A small reproduction example will significantly speed up the process of the fix 🚀 |
Describe the bug
It happens that when i try to paste a big chunk of text in a multiline TextInput that requires the KeyboardAwareScrollView to scroll, the scroll happens, but it's not as precise as in other times, it looks like it scrolls to much.
Code snippet
Cant share code since is a private repo, but its a TextInput inside a KeyboardAwareScrollView
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Having the right scroll space without scrolling too much
Screenshots
Screen.Recording.2024-01-30.at.09.36.17.mov
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: