[Docs] Fix incorrect Icon in search after Navigation#4641
Merged
vnbaaij merged 1 commit intomicrosoft:devfrom Mar 22, 2026
Merged
[Docs] Fix incorrect Icon in search after Navigation#4641vnbaaij merged 1 commit intomicrosoft:devfrom
vnbaaij merged 1 commit intomicrosoft:devfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the docs site’s navigation search implementation to correctly reset the FluentAutocomplete “clear (X)” icon after an item is selected and the app navigates, by switching from a “multi-select with max 1” setup to true single-select binding.
Changes:
- Configure the
FluentAutocompleteas single-select (Multiple="false"). - Replace
SelectedOptionsbinding withSelectedOptionbinding and update click handler state clearing accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/Demo/Shared/Shared/DemoSearch.razor | Switches the autocomplete to single-select and binds to SelectedOption instead of SelectedOptions. |
| examples/Demo/Shared/Shared/DemoSearch.razor.cs | Updates the backing field and navigation handler to use/clear a single selected option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
@microsoft-github-policy-service agree |
vnbaaij
approved these changes
Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
📖 Description
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.
Updating the component to use
Multiple="false"fixes this issue and still allows for correct handling of navigation.I had originally ran into this issue myself as when implementing a similar Navigation Search for my own project where I used the docs as a starting point for how best to achieve this with FluentUI.
🎫 Issues
👩💻 Reviewer Notes
Current Behaviour:

Behaviour After Changes:

📑 Test Plan
Manually testing after making the change to see that the icon correctly updates to the search icon when navigating matching the expended behaviour as the search input text clears. Checked with both mouse clicks, and keyboard arrow keys + enter.
As this change is just to the docs page rather than a change to the component library itself, I don't believe there is any unit testings that covers this. However if I'm wrong, please just let me know and I'd be happy to add something in.
✅ Checklist
General
⏭ Next Steps