From 1d75aad5e9fc6a85efa4e1ffeef8f38afacdb119 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Wed, 25 Sep 2024 12:26:58 +0200 Subject: [PATCH] chore: Remove legacy key handling on ComboBoxItems --- .../UI/Xaml/Controls/ComboBox/ComboBoxItem.cs | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBoxItem.cs b/src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBoxItem.cs index 7e5512359682..3ad8e167891f 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBoxItem.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBoxItem.cs @@ -14,31 +14,6 @@ public ComboBoxItem() DefaultStyleKey = typeof(ComboBoxItem); } - protected override void OnKeyDown(KeyRoutedEventArgs args) - { - if (ItemsControl.ItemsControlFromItemContainer(this) is ComboBox comboBox) - { - if ((args.Key is VirtualKey.Enter or VirtualKey.Space) && comboBox.IsDropDownOpen) - { - var item = comboBox.ItemFromContainer(this); - if (item != null) - { - comboBox.SelectedItem = item; - comboBox.IsDropDownOpen = false; - args.Handled = true; - } - } - - if (!args.Handled) - { - // Fallback to combobox keydown handling - args.Handled = comboBox.TryHandleKeyDown(args, this); - } - } - - base.OnKeyDown(args); - } - internal void ChangeVisualStateInternal(bool useTransitions) => ChangeVisualState(useTransitions); private protected override void ChangeVisualState(bool useTransitions)