Skip to content

Commit 5f5d49c

Browse files
authored
Merge pull request #53 from mitchcapper/fix_all_combo_suggestions_shown_incorrectly_pr
Fix combobox from showing all results when should be filtered Tested the demos and the behavior didn´t change.
2 parents 6d4beeb + b6d2fd4 commit 5f5d49c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

AutoCompleteTextBox/AutoCompleteTextBox/Editors/AutoCompleteComboBox.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ private void Expander_Expanded(object sender, RoutedEventArgs e)
351351
{
352352
_suggestionsAdapter = new SuggestionsAdapter(this);
353353
}
354-
_suggestionsAdapter.ShowFullCollection();
354+
if (SelectedItem != null || String.IsNullOrWhiteSpace(Editor.Text))
355+
_suggestionsAdapter.ShowFullCollection();
355356

356357
}
357358

@@ -540,14 +541,14 @@ public SuggestionsAdapter(AutoCompleteComboBox actb)
540541

541542
public void GetSuggestions(string searchText)
542543
{
543-
_filter = searchText;
544544
_actb.IsLoading = true;
545545
// Do not open drop down if control is not focused
546546
if (_actb.IsKeyboardFocusWithin)
547547
_actb.IsDropDownOpen = true;
548548
_actb.ItemsSelector.ItemsSource = null;
549549
ParameterizedThreadStart thInfo = GetSuggestionsAsync;
550550
Thread th = new Thread(thInfo);
551+
_filter = searchText;
551552
th.Start(new object[] { searchText, _actb.Provider });
552553
}
553554
public void ShowFullCollection()

0 commit comments

Comments
 (0)