From 460877bc68aa2f4bacc6ba97d831b986d69f29ad Mon Sep 17 00:00:00 2001 From: Bron Davies Date: Fri, 23 Oct 2026 12:32:45 -0600 Subject: [PATCH] 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];