Skip to content

Commit 0ab026f

Browse files
authored
Code Quality: Fixed Omnibar cursor placement when changing text (#17249)
1 parent 6e5a3fb commit 0ab026f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Files.App.Controls/Omnibar/Omnibar.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Files Community
22
// Licensed under the MIT License.
33

4-
using Microsoft.UI.Xaml.Controls;
54
using Microsoft.UI.Xaml.Markup;
65
using Microsoft.UI.Xaml.Media.Animation;
76
using Windows.Foundation;
@@ -246,7 +245,8 @@ internal protected void ChangeTextBoxText(string text)
246245
_textBox.Text = text;
247246

248247
// Move the cursor to the end of the TextBox
249-
_textBox?.Select(_textBox.Text.Length, 0);
248+
if (_textChangeReason == OmnibarTextChangeReason.SuggestionChosen)
249+
_textBox?.Select(_textBox.Text.Length, 0);
250250
}
251251

252252
private void SubmitQuery(object? item)

0 commit comments

Comments
 (0)