Skip to content

Fix editable ComboBox Shift+Tab keyboard trap in WPF Gallery (ADO 3019001)#794

Open
wnvko-msft wants to merge 1 commit into
microsoft:mainfrom
wnvko-msft:mvenkov/fix-basic-inputs-combo-shift-tab-issue
Open

Fix editable ComboBox Shift+Tab keyboard trap in WPF Gallery (ADO 3019001)#794
wnvko-msft wants to merge 1 commit into
microsoft:mainfrom
wnvko-msft:mvenkov/fix-basic-inputs-combo-shift-tab-issue

Conversation

@wnvko-msft

@wnvko-msft wnvko-msft commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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 DefaultComboBoxStyle IsEditable=True trigger only swaps the control template - unlike the classic/Aero theme, it never sets IsTabStop="False" on the ComboBox. As a result, an editable ComboBox exposes two tab stops: the ComboBox itself and its inner PART_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 in Views/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

  • Sample-only change; one XAML file touched.
  • The underlying Fluent-theme defect still affects other editable ComboBoxes and may warrant a separate upstream fix in dotnet/wpf.

Testing

  • Verified Shift+Tab from the editable ComboBox now moves focus to the previous control.
  • dotnet build succeeds (0 errors).

Accessibility

  • MAS 2.1.1 – Keyboard / WCAG 2.1.1
Microsoft Reviewers: Open in CodeFlow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant