Fix SHIFT+F10 keyboard shortcut for context menu in TextInput#15621
Open
Nitin-100 wants to merge 4 commits intomicrosoft:mainfrom
Open
Fix SHIFT+F10 keyboard shortcut for context menu in TextInput#15621Nitin-100 wants to merge 4 commits intomicrosoft:mainfrom
Nitin-100 wants to merge 4 commits intomicrosoft:mainfrom
Conversation
28194ac to
8c0bda7
Compare
acoates-ms
requested changes
Feb 3, 2026
8c0bda7 to
525ebd2
Compare
acoates-ms
reviewed
Feb 5, 2026
vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h
Outdated
Show resolved
Hide resolved
1153457 to
b47add3
Compare
- Add ContextMenuRoutedEventArgs interface to Composition.Input.idl - Add ContextMenu event to ComponentView.idl - Implement ContextMenuRoutedEventArgs in Composition.Input.h/cpp - Add ContextMenu event handlers in ComponentView.h/cpp - Subscribe to InputKeyboardSource.ContextMenuKey for ContentIsland hosting - Handle WM_CONTEXTMENU for HWND hosting - Implement OnContextMenu in WindowsTextInputComponentView
b47add3 to
13de5f2
Compare
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.
Description
This PR fixes the SHIFT+F10 keyboard shortcut not working to show the context menu in TextInput components. Previously, pressing SHIFT+F10 would cause the application's File menu to blink instead of showing the TextInput context menu.
Type of Change
Why
The SHIFT+F10 keyboard shortcut is a standard Windows accessibility feature for opening context menus. Users expect this shortcut to work in TextInput fields to access cut/copy/paste operations via keyboard.
Root Cause: Windows intercepts SHIFT+F10 at the system level. For ContentIsland hosting, the
InputKeyboardSource.ContextMenuKeyevent wasn't being handled, so the event would fall through and activate the application's menu bar instead.What
The following changes were made to fix the issue:
Added
ContextMenuRoutedEventArgsinterface toComposition.Input.idl- New args class withHandled,Position, andIsKeyboardTriggeredproperties. This follows the same pattern asKeyRoutedEventArgs/CharacterReceivedRoutedEventArgsfor easy future extension without breaking API changes.Added
ContextMenupublic event toComponentView.idl- Allows native components to customize context menu behavior by subscribing to this event.Added
OnContextMenuvirtual method toComponentView- Base class method that derived components can override to handle context menu requests.Added
ContextMenuKeyevent handler inCompositionEventHandler- For ContentIsland hosting, this subscribes toInputKeyboardSource.ContextMenuKeyand routes the event to the focused component'sOnContextMenumethod.Added
WM_CONTEXTMENUhandling inCompositionEventHandler::SendMessage- For HWND hosting (CompositionHwndHost), this routes the WM_CONTEXTMENU message to the focused component.Implemented
OnContextMenuinWindowsTextInputComponentView- CallsShowContextMenu()when the context menu is not hidden via props.Screenshots
N/A - This is a keyboard interaction fix. Testing requires:
Testing
Manual Testing Performed:
contextMenuHiddenprop still prevents context menu from appearingTest Scenarios:
contextMenuHidden={true}+ SHIFT+F10 → No context menuChangelog
Should this change be included in the release notes: yes
Fixed SHIFT+F10 keyboard shortcut not showing context menu in TextInput components.