Skip to content

feat(textinput): Add a scrollview to multiline TextInput - #2726

Merged
Saad Najmi (Saadnajmi) merged 6 commits into
mainfrom
more
Oct 13, 2025
Merged

feat(textinput): Add a scrollview to multiline TextInput#2726
Saad Najmi (Saadnajmi) merged 6 commits into
mainfrom
more

Conversation

@Saadnajmi

Copy link
Copy Markdown
Collaborator

Summary:

Cherry pick more commits from #2117 , this time to add a scrollview to multiline textinout

Test Plan:

Existing test page works, although, TextInput needs more love.

Nick Lefeverand others added 4 commits October 10, 2025 11:23
Summary:
The multiline text input view on macOS needs its own view hierarchy, wrapping the RCTUITextView in a scroll view to support all the features offered by the React TextInput component.
This diff adds a wrapper class for RCTUITextView that provides the appropriate view hierarchy while still supporting the text input protocols required for text input.
The wrapper forwards all unimplemented methods to the RCTUITextView so that it can be used as a direct substitute for the RCTUITextView. This allows us to reduce the custom changes need for macOS in RCTTextInputComponentView while re-using all the logic in RCTUITextView.
Test Plan: Tested later in this stack.
Reviewers: shawndempsey, #rn-desktop
Reviewed By: shawndempsey
Differential Revision: https://phabricator.intern.facebook.com/D51962394
Tasks: T167538822, T157889591
Tags: uikit-diff
Summary:
Add a `responder` property to support assigning the first responder to the actual textfield/textview if the view is wrapped or not.
The wrapped text view already implements this property. This diff brings the same functionality to the text field and declares it on the common protocol.
Test Plan: Tested later in this stack.
Reviewers: shawndempsey, chpurrer, #rn-desktop
Reviewed By: shawndempsey, chpurrer
Differential Revision: https://phabricator.intern.facebook.com/D51962395
Tasks: T167538822, T157889591
Summary:
This diff updates the core TextInput RN component to use the wrapped text view for multiline TextInput.
Switching to `RCTWrappedTextView` enables correct `borderWidth` and `contentInsets` support for multi line text inputs while maintaining the same functionality for single line text input.
Scrolling text views are also supported correctly, with vertical height dependent scrollers.
Test Plan:
- Build Zeratul with Fabric enabled.
- Type in the search field to test the layout of the text contents
- Type in the composer to test multi line support and the layout of the text contents
| Before | After |
|--|
| https://pxl.cl/3Xrrx | https://pxl.cl/3Xrr9 |
Reviewers: shawndempsey, #rn-desktop
Reviewed By: shawndempsey
Differential Revision: https://phabricator.intern.facebook.com/D51962396
Tasks: T167538822, T157889591
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
@Saadnajmi
Saad Najmi (Saadnajmi) merged commit fdfba41 into mainOct 13, 2025
21 checks passed
Sign up for freeto 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

@Saadnajmi@tido64