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
@@ -318,20 +318,21 @@ namespace PowerLauncher
|
|||||||
|
|
||||||
private void QueryTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
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)
|
if (_isTextSetProgrammatically)
|
||||||
{
|
{
|
||||||
var textBox = (TextBox)sender;
|
|
||||||
textBox.SelectionStart = textBox.Text.Length;
|
textBox.SelectionStart = textBox.Text.Length;
|
||||||
_isTextSetProgrammatically = false;
|
_isTextSetProgrammatically = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var text = ((TextBox)sender).Text;
|
|
||||||
if (string.IsNullOrEmpty(text))
|
|
||||||
{
|
|
||||||
SearchBox.AutoCompleteTextBlock.Text = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
_viewModel.QueryText = text;
|
_viewModel.QueryText = text;
|
||||||
_viewModel.Query();
|
_viewModel.Query();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user