Skip to content

Fix font face keyboard selection crash#20255

Open
danyalahmed1995 wants to merge 1 commit into
microsoft:mainfrom
danyalahmed1995:fix/20245-font-dropdown-enter-crash
Open

Fix font face keyboard selection crash#20255
danyalahmed1995 wants to merge 1 commit into
microsoft:mainfrom
danyalahmed1995:fix/20245-font-dropdown-enter-crash

Conversation

@danyalahmed1995
Copy link
Copy Markdown

Summary

Fixes a crash in the Settings UI font face control when selecting a font suggestion with the keyboard and pressing Enter.

The font face AutoSuggestBox path was explicitly unfocusing the box after a chosen suggestion was submitted. During the keyboard suggestion commit path, that Focus(FocusState::Unfocused) call can trigger a WinUI/XAML crash before the settings model update completes.

This change avoids explicitly unfocusing the AutoSuggestBox in the chosen-suggestion path and instead commits the selected font and moves focus to the parent container.

Fixes #20245.

Validation

Manually validated with a local CascadiaPackage Debug x64 build:

  • Reproduced the crash before the fix.
  • Opened Settings → Defaults → Appearance → Font face.
  • Typed a partial font name.
  • Used arrow keys to select a suggestion.
  • Pressed Enter.
  • Verified Terminal no longer crashes.
  • Verified the selected font is applied and Save works.

Also checked:

git diff --check
git diff --numstat

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.

Crashes when pressing Enter after selecting a font from the font dropdown

1 participant