From e1b6946a531d44f1548297efabdd168ff71e38c0 Mon Sep 17 00:00:00 2001 From: Sebastian Bogle Date: Sat, 21 Mar 2026 18:28:09 +0000 Subject: [PATCH] [Docs] Fix incorrect Icon in search after Navigation Fix an issue where the 'X' icon would remain visible on the Docs Search input after a user has selected an item and navigated away. This is due to the check that the Autocomplete component does where with this component usage, this.SelectedOption is not null at this point. --- examples/Demo/Shared/Shared/DemoSearch.razor | 6 +++--- examples/Demo/Shared/Shared/DemoSearch.razor.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/Demo/Shared/Shared/DemoSearch.razor b/examples/Demo/Shared/Shared/DemoSearch.razor index 35c1bf5a01..c2066809c0 100644 --- a/examples/Demo/Shared/Shared/DemoSearch.razor +++ b/examples/Demo/Shared/Shared/DemoSearch.razor @@ -1,13 +1,13 @@  diff --git a/examples/Demo/Shared/Shared/DemoSearch.razor.cs b/examples/Demo/Shared/Shared/DemoSearch.razor.cs index cf45c92819..346c8cb4d3 100644 --- a/examples/Demo/Shared/Shared/DemoSearch.razor.cs +++ b/examples/Demo/Shared/Shared/DemoSearch.razor.cs @@ -21,7 +21,7 @@ public partial class DemoSearch : IAsyncDisposable private FluentAutocomplete? _searchAutocomplete = default!; private string? _searchTerm = ""; - private IEnumerable? _selectedOptions = []; + private NavItem? _selectedOption = null; protected override void OnInitialized() { @@ -57,8 +57,8 @@ private void HandleSearchInput(OptionsSearchEventArgs e) private void HandleSearchClicked() { _searchTerm = null; - var targetHref = _selectedOptions?.SingleOrDefault()?.Href; - _selectedOptions = []; + var targetHref = _selectedOption?.Href; + _selectedOption = null; InvokeAsync(StateHasChanged); // Ignore clearing the search bar