Skip to content

Code Quality: Fixed Omnibar cursor placement when changing text #17249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Files.App.Controls/Omnibar/Omnibar.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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)
Expand Down
Loading