mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Fix issue with autocomplete text remaining on clearing query (#6220)
This commit is contained in:
committed by
GitHub
parent
6a531ca57c
commit
fe8727bd94
@@ -317,21 +317,22 @@ namespace PowerLauncher
|
||||
private bool disposedValue;
|
||||
|
||||
private void QueryTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (_isTextSetProgrammatically)
|
||||
{
|
||||
var textBox = (TextBox)sender;
|
||||
textBox.SelectionStart = textBox.Text.Length;
|
||||
_isTextSetProgrammatically = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var text = ((TextBox)sender).Text;
|
||||
var text = textBox.Text;
|
||||
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
SearchBox.AutoCompleteTextBlock.Text = string.Empty;
|
||||
}
|
||||
|
||||
if (_isTextSetProgrammatically)
|
||||
{
|
||||
textBox.SelectionStart = textBox.Text.Length;
|
||||
_isTextSetProgrammatically = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_viewModel.QueryText = text;
|
||||
_viewModel.Query();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user