Add onAuxClick event for right-click handling#2885
Draft
Saadnajmi wants to merge 2 commits intomicrosoft:mainfrom
Draft
Add onAuxClick event for right-click handling#2885Saadnajmi wants to merge 2 commits intomicrosoft:mainfrom
Saadnajmi wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Implements onAuxClick following the same pattern as onDoubleClick, wired end-to-end from native rightMouseUp: through C++ event emitters to JS. Also adds a `button` field to MouseEvent and filters non-primary button clicks from triggering onPress in Pressability. Inspired by microsoft/react-native-windows#15920. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Port the shared changes from facebook#56298: - Add onAuxClick/onAuxClickCapture to TouchEventEmitter (shared C++) - Add AuxClick/AuxClickCapture to ViewEvents in primitives.h - Add prop conversions in propsConversions.h - Register topAuxClick as a bubbling event in BaseViewConfig.ios.js - Add dispatch logic in RCTSurfacePointerHandler.mm (iOS path) - Type onAuxClick as PointerEvent in PointerEventProps (Flow + TS) Remove redundant macOS-specific JS registrations since macOS now inherits the bubbling event from the iOS base config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was
linked to
issues
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onAuxClickevent, matching the upstream implementation in facebook/react-native#56298onAuxClick/onAuxClickCapturetoTouchEventEmitter,ViewEvents(primitives.h),propsConversions.h,BaseViewConfig.ios.js(bubbling event),RCTSurfacePointerHandler.mm(iOS dispatch), andPointerEventPropstypesRCTSurfacePointerHandler.mm(guarded with#if !TARGET_OS_OSX), adds native wiring throughRCTViewComponentView.mm(rightMouseUp:→HostPlatformViewEventEmitter::onAuxClick)buttonfield to the macOSMouseEventstruct (W3C spec: 0=left, 1=middle, 2=right)onPressinPressability, so right-clicking aPressableno longer fires its press handlerTest plan
onAuxClickfires on right-click on a<View>in RNTesteronPressdoes not fire on right-click on a<Pressable>onDoubleClickand other existing mouse events still workevent.nativeEvent.buttonreports correct values (0 for left, 2 for right)🤖 Generated with Claude Code