diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml.cs b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml.cs index d34e9dcb33a8d..b1ce11fbb270d 100644 --- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml.cs +++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml.cs @@ -164,6 +164,7 @@ private void ItemsPresenter_PreviewMouseUp(object sender, MouseButtonEventArgs e private void InnerTextBox_GotFocus(object sender, RoutedEventArgs e) { + e.Handled = true; // Prevent selecting all the text if (!_smartRenameViewModel.IsUsingDropdown) { return; @@ -185,8 +186,7 @@ private void InnerTextBox_PreviewKeyDown(object sender, KeyEventArgs e) { Assumes.NotNull(_dropDownPopup); if ((e.Key is Key.Escape or Key.Space or Key.Enter) - && (_dropDownPopup.IsOpen // Handle these keystrokes when dropdown is present - || _smartRenameViewModel.IsUsingResultPanel && this.TextSelectionLength < this.Text.Length)) // Or when panel is present and text is not yet selected + && _dropDownPopup.IsOpen) // Handle these keystrokes when dropdown is present { _dropDownPopup.IsOpen = false; SelectAllText();