Skip to content

fix(macos): keep a press on a view from reaching a text field beneath it - #3143

Open
Bron Davies (brondavies) wants to merge 1 commit into
microsoft:mainfrom
brondavies:fix/view-keeps-mouse-down
Open

Bron Davies (brondavies) wants to merge 1 commit into
microsoft:mainfrom
brondavies:fix/view-keeps-mouse-down

Conversation

@brondavies

Copy link
Copy Markdown

Summary:

On macOS, a Pressable drawn over a TextInput never fires onPress. The surface's touch handler gets the press, but RCTViewComponentView doesn't implement mouseDown:, so NSView's default passes it on (through -_nextResponderForEvent:) to the overlapping text field beneath the point. The field's tracking loop then consumes the mouseUp, and the press never ends.

This accepts mouseDown: in RCTViewComponentView, as rightMouseDown: already does for the same reason.

Test Plan:

RNTester-macOS (Debug, arm64, Xcode 27.1, macOS 26.6.2), Playground with a Pressable absolutely positioned over a TextInput:

  • On main, sending the button's view mouseDown: (lldb) reaches -[NSTextField mouseDown:] of the field beneath.
  • With this change, it stops at the button.
  • In an app on 0.83.0 with the same change, real clicks on such a button fire onPress; before it, they didn't.

@brondavies
Bron Davies (brondavies) requested a review from a team as a code owner October 23, 2026 18:33
@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