From 460877bc68aa2f4bacc6ba97d831b986d69f29ad Mon Sep 17 00:00:00 2001 From: Bron Davies Date: Fri, 23 Oct 2026 12:32:45 -0600 Subject: [PATCH 1/2] fix(macos): keep a press on a view from reaching a text field beneath it --- .../Mounting/ComponentViews/View/RCTViewComponentView.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 473eab307dca..aa827366d07d 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -2323,6 +2323,14 @@ - (void)mouseExited:(NSEvent *)event [self emitMouseEvent:MouseLeave]; } +- (void)mouseDown:(NSEvent *)event +{ + // Accept mouseDown: the surface's touch handler, a gesture recognizer, has already taken the + // press. NSView's default passes it on to an overlapping sibling view beneath the point, and a + // text field there starts a tracking loop that consumes the mouseUp, so a button drawn over a + // TextInput would never be pressed. +} + - (void)mouseUp:(NSEvent *)event { BOOL hasDoubleClickEventHandler = _props->hostPlatformEvents[HostPlatformViewEvents::Offset::DoubleClick]; From 3302f5fe51cb2780651873858fcfd5d6fbba84a0 Mon Sep 17 00:00:00 2001 From: Bron Davies Date: Tue, 17 Nov 2026 10:10:09 -0700 Subject: [PATCH 2/2] fix(macos): keep mouseDown only on views that can't move the window --- .../Mounting/ComponentViews/View/RCTViewComponentView.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index aa827366d07d..3775eea3ff54 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -2325,10 +2325,11 @@ - (void)mouseExited:(NSEvent *)event - (void)mouseDown:(NSEvent *)event { - // Accept mouseDown: the surface's touch handler, a gesture recognizer, has already taken the - // press. NSView's default passes it on to an overlapping sibling view beneath the point, and a - // text field there starts a tracking loop that consumes the mouseUp, so a button drawn over a - // TextInput would never be pressed. + // Accept mouseDown on views that can't move the window, such as Pressable, so it isn't passed on + // to a text field beneath, whose tracking loop would consume the mouseUp the press needs. + if (self.mouseDownCanMoveWindow) { + [super mouseDown:event]; + } } - (void)mouseUp:(NSEvent *)event