Skip to content

Commit

Permalink
Fix issue with autocomplete text remaining on clearing query (#6220)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrivastavv authored Aug 28, 2020
1 parent 6a531ca commit fe8727b
Showing 1 changed file with 8 additions and 7 deletions.
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

0 comments on commit fe8727b

Please sign in to comment.