Skip to content

feat: scroll to input's caret and when user types#723

Merged
lodev09 merged 3 commits into
lodev09:mainfrom
bigcupcoffee:feat/scroll-to-caret
Jul 11, 2026
Merged

feat: scroll to input's caret and when user types#723
lodev09 merged 3 commits into
lodev09:mainfrom
bigcupcoffee:feat/scroll-to-caret

Conversation

@bigcupcoffee

Copy link
Copy Markdown
Contributor

Summary

Quick disclaimer: when I was recording the clips, I encountered a crash when grabbing the caret, upon rebuilding with Xcode to monitor it, it vanished, I'm still somewhat concerned of this, worth testing

This is not a lot of code for a decent UX requirement. Whenever user types it scrolls to the caret

Resolves two issues:

  • Handle growing multiline input? #705 - scrolls to the caret as user keeps typing
  • scrolls to the caret with keyboardOffset in mind, instead of textinput bounds, which handles taller inputs a bit better

This does not handle cases of a caret movement via other means (other than typing), because handling that would require:

  • iOS: delegate/subclass proxy OR polling/gesture workarounds
  • Android: subclassing ReactEditText (onSelectionChanged) OR hijacking its AccessibilityDelegate (TYPE_VIEW_TEXT_SELECTION_CHANGED)

This is showcased on the videos - moving caret upwards (on iOS) doesn't scroll to it, user has to type first. On Android upwards is handled by the platform, but moving it down also doesn't scroll to it, making the user type

Since you can achieve an okayish UX with a clean and minimal diff, I figured I'll PR this anyway even though #705 was closed

Type of Change

  • New feature

Test Plan

Simulators

Screenshots / Videos

iOS Android
iOS Android

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)
  • I added a changelog entry (if needed)

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

@bigcupcoffee is attempting to deploy a commit to the lodev09 Team on Vercel.

A member of the Team first needs to authorize it.

@bigcupcoffee

Copy link
Copy Markdown
Contributor Author

@lodev09 since it's not that much code does it have a chance to merge?

@github-actions

Copy link
Copy Markdown

Hey @bigcupcoffee, this PR is missing a changelog entry.

Add the following under the Unreleased section in CHANGELOG.md:

- **platform**: Description. ([#723](https://github.com/lodev09/react-native-true-sheet/pull/723) by [@bigcupcoffee](https://github.com/bigcupcoffee))

See CONTRIBUTING.md for more details.

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-true-sheet Ready Ready Preview, Comment Jul 11, 2026 4:34pm

Request Review

…board is shown

Co-Authored-By: Jovanni Lo <lodev09@gmail.com>
@lodev09 lodev09 merged commit edeb620 into lodev09:main Jul 11, 2026
6 checks passed
@lodev09

lodev09 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

🚀 This pull request is included in v3.11.4. See Release 3.11.4 for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants