Skip to content

fix(macos): let a ScrollView scroll over a multiline TextInput - #3146

Open
Bron Davies (brondavies) wants to merge 1 commit into
microsoft:mainfrom
brondavies:fix/multiline-input-passes-scroll
Open

Bron Davies (brondavies) wants to merge 1 commit into
microsoft:mainfrom
brondavies:fix/multiline-input-passes-scroll

Conversation

@brondavies

@brondavies Bron Davies (brondavies) commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary:

On macOS, a ScrollView doesn't scroll while the pointer is over a multiline TextInput inside it. RCTWrappedTextView keeps its text in an NSScrollView, which keeps every scroll event it's sent, even with nothing to scroll.

Its scroll view now passes on any scroll its text can't follow. While the text fits, or with scrollEnabled={false}, that's every scroll. Once the text overflows, it's a scroll past the top or bottom. It decides when a gesture starts: on each wheel notch, or on a trackpad's MayBegin or Began. So a gesture and its momentum stay with one scroll view.

Test Plan:

RNTester-macOS (Debug, arm64, Xcode 27.1, macOS 26.6.2). The Playground had a ScrollView holding an empty multiline TextInput, one with 30 lines, and a 600pt spacer. I sent wheel events from lldb to the text view hit-tested under each input:

  • On main (same build, the scroll view's class swapped back to RCTUIScrollView), the ScrollView stays put over both inputs, even with the long one scrolled to its end.
  • With this change, a notch over the empty input scrolls the ScrollView 30pt, and back. Over the long one, the input scrolls to its end (14 notches), then the ScrollView scrolls. Going up, the input scrolls back to its top, then the ScrollView follows.

It's the same in an app on 0.83.0 with this patched in.

I checked trackpad gestures in a standalone AppKit harness: the MayBegin and Began events decide, and the rest follows. I didn't check them with a real trackpad.

@brondavies
Bron Davies (brondavies) requested a review from a team as a code owner October 23, 2026 19:29
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

This branch has not been deployed

No deployments
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.

1 participant