Fix editable ComboBox Shift+Tab keyboard trap in WPF Gallery (ADO 3019001)#794
Open
wnvko-msft wants to merge 1 commit into
Open
Conversation
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
Fixes a keyboard trap on the Basic Input -> ComboBox page of WPF Gallery. When focus is on the editable ComboBox's edit field, pressing Shift+Tab does not move focus to the previous control, trapping keyboard users.
Fixes ADO 3019001.
Root cause
The .NET Fluent theme's
DefaultComboBoxStyleIsEditable=Truetrigger only swaps the control template - unlike the classic/Aero theme, it never setsIsTabStop="False"on the ComboBox. As a result, an editable ComboBox exposes two tab stops: the ComboBox itself and its innerPART_EditableTextBox. Shift+Tab from the edit field lands on the ComboBox container, which redirects focus back into the edit field, so focus never leaves the control. (Forward Tab happens to escape; Shift+Tab does not.)Fix
Set
IsTabStop="False"on the editable ComboBox inViews/BasicInput/ComboBoxPage.xaml, leaving only the inner edit field as a tab stop (mirroring the classic-theme behavior). Shift+Tab now moves focus to the previous control.Scope / notes
Testing
dotnet buildsucceeds (0 errors).Accessibility
Microsoft Reviewers: Open in CodeFlow