Skip to content
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

Library does not work with inputs that cover entire screen #578

Open
nicolaosm opened this issue Sep 2, 2024 · 10 comments
Open

Library does not work with inputs that cover entire screen #578

nicolaosm opened this issue Sep 2, 2024 · 10 comments
Assignees
Labels
🐛 bug Something isn't working KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component

Comments

@nicolaosm
Copy link

Describe the bug
When using a large multi-line text input field, the view does not automatically scroll to the cursor when it is placed somewhere within the text. This issue occurs particularly when the text field is large in height.

Code snippet
This issue can be reproduced with any basic text input field that has a height of 900 units or more.

To Reproduce
Steps to reproduce the behavior:

  1. Create a TextInput field with a height of 900 units.
  2. Fill the input with enough text to require scrolling.
  3. Place the caret (cursor) at a position within the text that is not currently visible on the screen.

Expected behavior
The view should automatically scroll to make the cursor visible whenever it is placed within the text.

Screenshots
A video demonstrating the issue:: https://cln.sh/HLlnFNpZ

Smartphone (please complete the following information):

  • Device: any iphone or android
  • RN version: 0.74.3
  • RN architecture: old
  • Library version: 1.13.3 (latest)
@nicolaosm nicolaosm changed the title Library works poorly with multi-line text inputs Library does not work with multi-line text inputs Sep 3, 2024
@kirillzyusko
Copy link
Owner

Hey @nicolaosm

Thank you for bringing that issue 😍

I think a similar problem was reported in #512

Do you expect the cursor to be visible when you set a focus, right? Because the second issue is more about incorrect position during typing 🤔

@kirillzyusko kirillzyusko added the KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component label Sep 3, 2024
@nicolaosm
Copy link
Author

Hi @kirillzyusko,

Yes you’re right. In my recorded video there are two issues showing:

  1. When we set focus, the scroll view is not animating to the correct position of the cursor. (Happening in multi line/large text inputs)
  2. When we type on the keyboard, the scroll view is not auto scrolling to the correct position to show us the cursor and where we are typing.

I’m not sure if this issue is actually related to #512 It seems to me to be a different issue.

Thanks @kirillzyusko

@kirillzyusko
Copy link
Owner

@nicolaosm cool, thank you for clarification!

It may be different problems, but in the end all of them will be fixed by utilizing onSelectionChange event (instead of relying on layout of text input).

I'll try to fix it - all native code is in place, I just need to re-work JS part, so it shouldn't be a big challenge 👀

@kirillzyusko kirillzyusko added the 🐛 bug Something isn't working label Sep 3, 2024
@nicolaosm
Copy link
Author

Thats amazing @kirillzyusko! Thank you for your quick and proactive approach. 🤩

@GhayoorUlHaq
Copy link

GhayoorUlHaq commented Sep 6, 2024

getting same issue as well, waiting for fix @kirillzyusko
Thanks 🙂

@kirillzyusko kirillzyusko changed the title Library does not work with multi-line text inputs Library does not work with inputs that cover entire screen Sep 11, 2024
@nicolaosm
Copy link
Author

Hi @kirillzyusko ! Any updates on this issue? Appreciate it, Thanks.

@kirillzyusko
Copy link
Owner

Hi @nicolaosm

No, I've been trying to re-work KeyboardAwareScrollView to depend on cursor position instead of layout, but for some reasons e2e tests become flaky and it needs more time for the investigation.

So I decided to prioritize OverKeyboardView feature and release it first. Since OverKeyboardView is released now so I'm prioritizing this issue again 👀

Also I was sick for 2 weeks, so it affected my performance in terms of fixing the bug 🙃 But I hope I will return to that issue this week and maybe will have potential fixes next week 👀 Let's see how it goes!

@nicolaosm
Copy link
Author

Thanks for the update @kirillzyusko! Hope you recovered and well now 🙏. Can't wait for a fix, hopefully it goes well!

@kirillzyusko
Copy link
Owner

kirillzyusko commented Oct 29, 2024

Sorry guys, it takes longer, than I initially expected - many random things went into the play that was urgent to resolve (edge-to-edge integration, RN 0.76 upgrade), so couldn't allocate a lot of time on fixing this 😔

Mostly that steals time is e2e "random" failures, but I can not skip them and don't investigate, just because I don't want to introduce a lot of breaking changes for existing users. I hope you understand me 😅

@nicolaosm
Copy link
Author

nicolaosm commented Oct 30, 2024

Hi @kirillzyusko! Thanks for dropping a message. Completely understand. Hopefully we'll have a fix soon 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component
Projects
None yet
Development

No branches or pull requests

3 participants