Repository: microsoft/terminal (language: cpp)

Issue:
 [Windows Terminal - Settings - Defaults]: Unable to navigate 'Font face' suggestions using keyboard in Appearance settings.
### Windows Terminal version

1.22.2362.0

### Windows build number

27695.1000

### Other Software

**Test Environment:**
OS: Windows 11 Version Dev (OS Build 27695.1000)
App: Windows Terminal Preview

### Steps to reproduce

**Repro steps:**
1. Open the 'windows terminal' application.
2. Open 'Settings' tab by pressing 'Ctrl+,' keys.
3. Navigate to the 'Defaults' tab and activate it.
4. Navigate to the 'Appearance' button and activate it.
6. Now navigate to 'Font face' edit field by tab key.
7. Suggestion will appear.
8. Now try to navigate in suggestion list by up/down arrow key. 
9. Observe the issue.

**User experience:**
Keyboard users, including those relying on assistive technologies, cannot efficiently browse and select font options from the 'Font face' suggestions. This significantly limits accessibility and hinders smooth navigation in the Appearance settings.

**WCAG Reference Link:**
https://www.w3.org/WAI/WCAG21/Understanding/keyboard

Attachment:
[Users are not able to navigate among the suggestions using keyboard.zip](https://github.com/user-attachments/files/16974239/Users.are.not.able.to.navigate.among.the.suggestions.using.keyboard.zip)

### Expected Behavior

Users should be able to navigate through the font suggestions using the up and down arrow keys without the list closing prematurely. The focus should remain within the list until a selection is made or the user navigates away.

### Actual Behavior

When focus lands on the 'Font face' edit field and suggestions appear, pressing the up or down arrow keys immediately selects the first option from the suggestion list and closes the list. Users cannot browse through the available font suggestions using the keyboard.


Discussion / hints:
This is marked as a Sev3 but after watching the video, I think it's something we should fix in this release (perhaps even service?). Assigning @lhecker since he introduced the new control in #16821. Putting it in the current milestone.

Fix patch:
diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.cpp b/src/cascadia/TerminalSettingsEditor/Appearances.cpp
index 3fcbfb58a2c..bd299e196ad 100644
--- a/src/cascadia/TerminalSettingsEditor/Appearances.cpp
+++ b/src/cascadia/TerminalSettingsEditor/Appearances.cpp
@@ -1030,9 +1030,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
         }
     }
 
-    void Appearances::FontFaceBox_SuggestionChosen(const AutoSuggestBox& sender, const AutoSuggestBoxSuggestionChosenEventArgs& args)
+    void Appearances::FontFaceBox_QuerySubmitted(const AutoSuggestBox& sender, const AutoSuggestBoxQuerySubmittedEventArgs& args)
     {
-        const auto font = unbox_value<Editor::Font>(args.SelectedItem());
+        const auto font = unbox_value<Editor::Font>(args.ChosenSuggestion());
         const auto fontName = font.Name();
         auto fontSpec = sender.Text();
 
diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.h b/src/cascadia/TerminalSettingsEditor/Appearances.h
index 27a58073a8f..97773d8e9fa 100644
--- a/src/cascadia/TerminalSettingsEditor/Appearances.h
+++ b/src/cascadia/TerminalSettingsEditor/Appearances.h
@@ -179,7 +179,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
 
         void FontFaceBox_GotFocus(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);
         void FontFaceBox_LostFocus(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);
-        void FontFaceBox_SuggestionChosen(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxSuggestionChosenEventArgs&);
+        void FontFaceBox_QuerySubmitted(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxQuerySubmittedEventArgs&);
         void FontFaceBox_TextChanged(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs&);
         void DeleteFontKeyValuePair_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);
         safe_void_coroutine BackgroundImage_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);
diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.xaml b/src/cascadia/TerminalSettingsEditor/Appearances.xaml
index a3f643c53c3..080f751b15e 100644
--- a/src/cascadia/TerminalSettingsEditor/Appearances.xaml
+++ b/src/cascadia/TerminalSettingsEditor/Appearances.xaml
@@ -214,10 +214,11 @@
                                     ItemTemplate="{StaticResource FontFaceComboBoxItemTemplate}"
                                     ItemsSource="{x:Bind FilteredFontList, Mode=OneWay}"
                                     LostFocus="FontFaceBox_LostFocus"
-                                    SuggestionChosen="FontFaceBox_SuggestionChosen"
+                                    QuerySubmitted="FontFaceBox_QuerySubmitted"
                                     Text="{x:Bind Appearance.FontFace, Mode=OneWay}"
                                     TextBoxStyle="{StaticResource TextBoxSettingStyle}"
-                                    TextChanged="FontFaceBox_TextChanged" />
+                                    TextChanged="FontFaceBox_TextChanged"
+                                    UpdateTextOnSelect="False" />
                     <CheckBox x:Name="ShowAllFontsCheckbox"
                               x:Uid="Profile_FontFaceShowAllFonts"
                               IsChecked="{x:Bind ShowAllFonts, Mode=TwoWay}" />


Test patch: