From b715008de3d94e65f56f896d884ce429079bfd32 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Thu, 3 Oct 2024 08:24:38 -0700 Subject: [PATCH] Revert "Stop updating AutoSuggestBox on selection" (#17989) Reverts microsoft/terminal#17961 Closes #17987 Reopens #17916 --- src/cascadia/TerminalSettingsEditor/Appearances.cpp | 4 ++-- src/cascadia/TerminalSettingsEditor/Appearances.h | 2 +- src/cascadia/TerminalSettingsEditor/Appearances.xaml | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.cpp b/src/cascadia/TerminalSettingsEditor/Appearances.cpp index bd299e196ad..3fcbfb58a2c 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_QuerySubmitted(const AutoSuggestBox& sender, const AutoSuggestBoxQuerySubmittedEventArgs& args) + void Appearances::FontFaceBox_SuggestionChosen(const AutoSuggestBox& sender, const AutoSuggestBoxSuggestionChosenEventArgs& args) { - const auto font = unbox_value(args.ChosenSuggestion()); + const auto font = unbox_value(args.SelectedItem()); const auto fontName = font.Name(); auto fontSpec = sender.Text(); diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.h b/src/cascadia/TerminalSettingsEditor/Appearances.h index 97773d8e9fa..27a58073a8f 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_QuerySubmitted(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxQuerySubmittedEventArgs&); + void FontFaceBox_SuggestionChosen(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxSuggestionChosenEventArgs&); 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 080f751b15e..a3f643c53c3 100644 --- a/src/cascadia/TerminalSettingsEditor/Appearances.xaml +++ b/src/cascadia/TerminalSettingsEditor/Appearances.xaml @@ -214,11 +214,10 @@ ItemTemplate="{StaticResource FontFaceComboBoxItemTemplate}" ItemsSource="{x:Bind FilteredFontList, Mode=OneWay}" LostFocus="FontFaceBox_LostFocus" - QuerySubmitted="FontFaceBox_QuerySubmitted" + SuggestionChosen="FontFaceBox_SuggestionChosen" Text="{x:Bind Appearance.FontFace, Mode=OneWay}" TextBoxStyle="{StaticResource TextBoxSettingStyle}" - TextChanged="FontFaceBox_TextChanged" - UpdateTextOnSelect="False" /> + TextChanged="FontFaceBox_TextChanged" />