From 1c242c209e19c7258126cfa904a08cc9003e104e Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:49:04 -0400 Subject: [PATCH] Code Quality: Fixed Omnibar cursor placement when changing text --- src/Files.App.Controls/Omnibar/Omnibar.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App.Controls/Omnibar/Omnibar.cs b/src/Files.App.Controls/Omnibar/Omnibar.cs index 5806676b5688..5695ee810c5e 100644 --- a/src/Files.App.Controls/Omnibar/Omnibar.cs +++ b/src/Files.App.Controls/Omnibar/Omnibar.cs @@ -1,7 +1,6 @@ // Copyright (c) Files Community // Licensed under the MIT License. -using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Markup; using Microsoft.UI.Xaml.Media.Animation; using Windows.Foundation; @@ -246,7 +245,8 @@ internal protected void ChangeTextBoxText(string text) _textBox.Text = text; // Move the cursor to the end of the TextBox - _textBox?.Select(_textBox.Text.Length, 0); + if (_textChangeReason == OmnibarTextChangeReason.SuggestionChosen) + _textBox?.Select(_textBox.Text.Length, 0); } private void SubmitQuery(object? item)