Skip to content

MudAutocomplete: ProgressBar AdornmentIcon Hiding#11980

Merged
danielchalmers merged 2 commits intoMudBlazor:devfrom
versile2:fix_adornmentprogress_11574
Oct 25, 2025
Merged

MudAutocomplete: ProgressBar AdornmentIcon Hiding#11980
danielchalmers merged 2 commits intoMudBlazor:devfrom
versile2:fix_adornmentprogress_11574

Conversation

@versile2
Copy link
Contributor

@versile2 versile2 commented Oct 20, 2025

Previously when you set ShowProgressIndicator was true it would always hide the icon regardless of situation. This PR changes that since the progress indicator is always at the end (RTL doesn't matter here) then we only hide the adornmenticon if it's at the end. Also added logic to only hide if it contains a circular bar, so if a user does their own template it won't hide (Most use the underline method)

Resolves #11574

Before:
AdornmentPrevious

After:
AdornmentProgress

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the style of this project.
  • I've added relevant tests or confirmed existing ones.

@mudbot mudbot bot added the bug Unexpected behavior or functionality not working as intended label Oct 20, 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

This pull request correctly adjusts the logic for hiding the adornment icon in MudAutocomplete when a progress indicator is shown. The changes ensure the icon is only hidden for end adornments and only when the default circular progress indicator is used, which aligns with the stated goals. A new visual test component has been added to demonstrate the new behavior across various configurations.

My review includes two main points:

  1. The new test component is missing some XML documentation for public members, which is required by the style guide.
  2. I've suggested adding bUnit tests to cover the new conditional styling logic introduced in the SCSS file, which would help prevent future regressions and aligns with the project's testing requirements for logic changes.

Comment on lines +29 to 30
&:not(:has(.mud-input-adornment-start)):has(.progress-indicator-circular) .mud-select-input .mud-icon-button {
display: none !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This CSS change introduces conditional rendering logic based on the presence of certain classes. While the new visual test component is helpful, it would be beneficial to add bUnit tests to programmatically verify this behavior and prevent future regressions. For example, you could add tests to AutocompleteTests.cs that assert the adornment icon is hidden or visible under different conditions (e.g., Adornment.Start vs Adornment.End, default progress indicator vs. custom template). The style guide requires unit tests for all logic changes.1

Style Guide References

Footnotes

  1. The style guide requires that all logic changes must include corresponding unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pretty sure I can't bunit css change?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, not without conditionally rendering it. I wonder why display: none was used initially instead, but it probably makes sense to leave it since this is just a minor patch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually the preferred method if my understanding is correct, you would only do conditional rendering in the event of older browsers which Blazor doesn't support. This one results in slightly less CSS. BUT the downside is this way is usually a bit more complex.

@danielchalmers danielchalmers changed the title MudAutoComplete: ProgressBar AdornmentIcon Hiding MudAutocomplete: ProgressBar AdornmentIcon Hiding Oct 25, 2025
@danielchalmers danielchalmers merged commit c2ed6d4 into MudBlazor:dev Oct 25, 2025
7 checks passed
This was referenced Nov 5, 2025
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.

MudAutocomplete Loses Adornment Icon when using ShowProgressIndicator

2 participants