Skip to content
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

Fix issue with autocomplete text not getting cleared #6220

Merged
Merged
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
15 changes: 8 additions & 7 deletions src/modules/launcher/PowerLauncher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,20 +318,21 @@ private void SuggestionsList_SelectionChanged(object sender, SelectionChangedEve

private void QueryTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
var textBox = (TextBox)sender;
var text = textBox.Text;

if (string.IsNullOrEmpty(text))
{
SearchBox.AutoCompleteTextBlock.Text = string.Empty;
}

if (_isTextSetProgrammatically)
{
var textBox = (TextBox)sender;
textBox.SelectionStart = textBox.Text.Length;
_isTextSetProgrammatically = false;
}
else
{
var text = ((TextBox)sender).Text;
if (string.IsNullOrEmpty(text))
{
SearchBox.AutoCompleteTextBlock.Text = string.Empty;
}

_viewModel.QueryText = text;
_viewModel.Query();
}
Expand Down