Skip to content

Commit 32c3743

Browse files
committed
fix suggestions not showing if no SuggestionRequested handler
1 parent 9b34912 commit 32c3743

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Input/RichSuggestBox/RichSuggestBox.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,10 @@ private async Task RequestSuggestionsAsync(ITextRange range = null)
561561
CancellationTokenSource = tokenSource
562562
};
563563

564+
var cancellationToken = tokenSource.Token;
565+
var eventArgs = new SuggestionRequestedEventArgs { QueryText = query, Prefix = prefix };
564566
if (SuggestionRequested != null)
565567
{
566-
var cancellationToken = tokenSource.Token;
567-
var eventArgs = new SuggestionRequestedEventArgs { QueryText = query, Prefix = prefix };
568568
try
569569
{
570570
await SuggestionRequested.InvokeAsync(this, eventArgs, cancellationToken);
@@ -573,12 +573,12 @@ private async Task RequestSuggestionsAsync(ITextRange range = null)
573573
{
574574
return;
575575
}
576+
}
576577

577-
if (!eventArgs.Cancel)
578-
{
579-
_suggestionChoice = 0;
580-
ShowSuggestionsPopup(_suggestionsList?.Items?.Count > 0);
581-
}
578+
if (!eventArgs.Cancel)
579+
{
580+
_suggestionChoice = 0;
581+
ShowSuggestionsPopup(_suggestionsList?.Items?.Count > 0);
582582
}
583583

584584
tokenSource.Cancel();

0 commit comments

Comments
 (0)