Skip to content

MudAutocomplete: Fix input not focused on adornment click#11970

Merged
danielchalmers merged 5 commits intoMudBlazor:devfrom
digitaldirk:FixAdornmentClickTyping
Nov 1, 2025
Merged

MudAutocomplete: Fix input not focused on adornment click#11970
danielchalmers merged 5 commits intoMudBlazor:devfrom
digitaldirk:FixAdornmentClickTyping

Conversation

@digitaldirk
Copy link
Member

When clicking on the adornment users could not start typing to search/filter results unless they clicked on the input directly. Added await FocusAsync(); after menu is opened from non-delegate AdornmentClick.

In the demos below after I click the input or adornment I am typing "test" on the keyboard. Before the fix the adornment does not allow me to type.
Before:
AdornmentClickBefore

After:
AdornmentClickAfter

Added await FocusAsync(); after menu is opened from non-delegate AdornmentClick
@mudbot mudbot bot changed the title Fix input not being focus on AdornmentClick Fix: Input not focused on adornment click Oct 17, 2025
@mudbot mudbot bot added the bug Unexpected behavior or functionality not working as intended label Oct 17, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request addresses an issue where the input field in the MudAutocomplete component was not automatically focused when clicking on the adornment. The fix adds await FocusAsync() after the menu is opened from a non-delegate AdornmentClick, improving the user experience by allowing users to immediately start typing after clicking the adornment. I have added a review comment to address a potential issue.

@mudbot mudbot bot changed the title Fix: Input not focused on adornment click MudAutocomplete: Fix input not focused on adornment click Oct 18, 2025
@ScarletKuro ScarletKuro requested a review from versile2 October 18, 2025 18:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes the issue where clicking the adornment on MudAutocomplete did not focus the input, preventing immediate typing.

  • Add FocusAsync after toggling the menu from an adornment click without a delegate.
  • Ensures keyboard input is accepted after clicking the adornment.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@versile2 versile2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, easy!

@digitaldirk digitaldirk marked this pull request as draft October 22, 2025 20:50
@digitaldirk
Copy link
Member Author

digitaldirk commented Oct 22, 2025

Awaiting test to make sure this doesn't happen again.

Ready :)

Added a test to ensure the input field is focused when the adornment icon is clicked.
@digitaldirk digitaldirk marked this pull request as ready for review October 27, 2025 21:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants