Skip to content

Preserve selected font face after focus changes#20359

Open
danyalahmed1995 wants to merge 4 commits into
microsoft:mainfrom
danyalahmed1995:fix/20353-font-face-value-reset
Open

Preserve selected font face after focus changes#20359
danyalahmed1995 wants to merge 4 commits into
microsoft:mainfrom
danyalahmed1995:fix/20353-font-face-value-reset

Conversation

@danyalahmed1995

Copy link
Copy Markdown
Contributor

Summary

Fixes the font face AutoSuggestBox resetting to its previous value, or stale filter text, after a keyboard-selected font is committed and focus later leaves the control.

WinUI restores its cached user query when the suggestion list closes. The existing LostFocus path then treated that programmatic restoration as fresh user input and committed the stale value.

This change distinguishes genuine user edits from programmatic text restoration, preserving the committed font value while retaining the queued selected-suggestion commit introduced by #20255.

Fixes #20353.

Validation

Manually validated with a local CascadiaPackage Debug x64 build:

  • Reproduced the reset before the fix.
  • Selected Lucida Console from Consolas using keyboard navigation.
  • Pressed Enter and confirmed Lucida Console was applied.
  • Returned focus to the Font face control and tabbed out again.
  • Verified Lucida Console remained selected.
  • Verified stale filter text did not return.
  • Verified the Crashes when pressing Enter after selecting a font from the font dropdown #20245 crash did not regress.
  • Verified Save and Discard changes both work.

@carlos-zamora

Copy link
Copy Markdown
Member

@danyalahmed1995 Thanks for working on this. Looks like there's merge conflicts with main. Once you merge main in, I'll come in and review it. 😊

@danyalahmed1995

Copy link
Copy Markdown
Contributor Author

Thanks man , I mistakenly fetched from origin instead of upstream 😅. Should be good now merged main into the branch and verified the build by running the build again

@carlos-zamora carlos-zamora left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

Verified this works locally. Also checked if this was an issue we had to worry about in the actions page (action type) but I didn't find the issue there, so we don't have to worry about it.

Comment thread src/cascadia/TerminalSettingsEditor/Appearances.cpp Outdated
@github-project-automation github-project-automation Bot moved this to To Cherry Pick in 1.25 Servicing Pipeline Jun 25, 2026
@github-project-automation github-project-automation Bot moved this to To Cherry Pick in 1.24 Servicing Pipeline Jun 25, 2026
@carlos-zamora carlos-zamora moved this from To Cherry Pick to To Consider in 1.24 Servicing Pipeline Jun 25, 2026
@carlos-zamora carlos-zamora moved this from To Cherry Pick to To Consider in 1.25 Servicing Pipeline Jun 25, 2026
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
@danyalahmed1995

Copy link
Copy Markdown
Contributor Author

Sounds good

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

Labels

None yet

Projects

Status: To Consider
Status: To Consider

Development

Successfully merging this pull request may close these issues.

Tabbing to "font face" AutoSuggestBox resets the value

2 participants