Repository navigation
Fix issue 14489: ToolStrip (TabStop=true) intercepts arrow keys after tab navigation, preventing TreeView from handling them - #14491
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR addresses a .NET 10/11 regression where a ToolStrip with TabStop=true can remain “active” in ModalMenuFilter after tab-navigation, causing arrow keys to be intercepted (e.g., preventing TreeView from handling them). The change narrows when a ToolStrip becomes active in menu mode and adds logic to clear the active ToolStrip when focus leaves ToolStrip context.
Changes:
- Gate
ModalMenuFilter.SetActiveToolStrip(this)inToolStrip.WndProc(WM_SETFOCUS)so it only runs for focus transitions originating from ToolStrip context (preserving #12916 behavior while avoiding #14489). - On
ToolStrip.OnLostFocus, remove the ToolStrip from the modal menu filter and potentially exit menu mode when focus moves outside ToolStrip context.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LeafShi1
left a comment
There was a problem hiding this comment.
Thanks for the fix, @SimonZhao888! The approach of gating SetActiveToolStrip on ToolStrip-context focus transitions and clearing on WM_KILLFOCUS makes sense. I have a few observations below.
KlausLoeffelmann
left a comment
There was a problem hiding this comment.
Looks good to me. If I understood correctly, the change is around ToolStrip (TabStop=true) intercepts arrow keys after tab navigation, preventing TreeView from handling them?
Thanks!
Fixes #14489, #14421
Proposed changes
Customer Impact
Regression?
Risk
Screenshots
Before
ToolStripIssue.mp4
After
2026-04-24.141412.mp4
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow