Skip to content

MudPicker & MudRangeInput: add customizable ClearIcon parameter#12425

Merged
danielchalmers merged 2 commits intoMudBlazor:devfrom
pwasilewski:piotr/clearIcon
Jan 13, 2026
Merged

MudPicker & MudRangeInput: add customizable ClearIcon parameter#12425
danielchalmers merged 2 commits intoMudBlazor:devfrom
pwasilewski:piotr/clearIcon

Conversation

@pwasilewski
Copy link
Contributor

@pwasilewski pwasilewski commented Jan 13, 2026

Description
The documentation for several components related to MudPicker and MudRangeInput mentions a ClearIcon parameter that can be used to customize the clear icon. However, this parameter was not available on the components themselves.

This PR adds support for ClearIcon to the affected components so the documented behavior is now supported.

Fix
Add ClearIcon support to MudPicker and derived components:

  • MudTimePicker
  • MudDatePicker
  • MudColorPicker

Add ClearIcon support to MudRangeInput and derived components:

  • MudDateRangePicker

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests

Documentation
image
image

feat(MudRangeInput): add customizable ClearIcon parameter
feat(MudDateRangePicker): use customizable ClearIcon parameter

Adds a ClearIcon parameter to MudPicker, MudRangeInput, and MudDateRangePicker components, allowing developers to specify a custom icon for the clear button when Clearable is enabled. Defaults to Icons.Material.Filled.Clear. Updates documentation and razor files to support this new property for improved UI flexibility.
@mudbot mudbot bot added the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Jan 13, 2026
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

This PR adds the previously documented but unimplemented ClearIcon parameter to MudBlazor picker and range input components, allowing users to customize the icon displayed when the Clearable feature is enabled.

Changes:

  • Added ClearIcon parameter to MudPicker base class (inherited by MudTimePicker, MudDatePicker, MudColorPicker)
  • Added ClearIcon parameter to MudRangeInput base class (inherited by MudDateRangePicker)
  • Updated component templates to use the ClearIcon parameter instead of hardcoded icon values

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/MudBlazor/Components/Picker/MudPicker.razor.cs Adds ClearIcon parameter definition with default value and documentation
src/MudBlazor/Components/Picker/MudPicker.razor Passes ClearIcon parameter to underlying MudTextField component
src/MudBlazor/Components/Input/MudRangeInput.razor.cs Adds ClearIcon parameter definition with default value and documentation
src/MudBlazor/Components/Input/MudRangeInput.razor Uses ClearIcon parameter for the clear button instead of hardcoded icon
src/MudBlazor/Components/DatePicker/MudDateRangePicker.razor Passes ClearIcon parameter through to MudRangeInput component

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

@danielchalmers danielchalmers added needs: tests A maintainer has explicitly asked for associated test cases to be added to this pull request needs: changes A maintainer has asked for further modifications to be made to this pull request labels Jan 13, 2026
Add unit tests to verify that a custom ClearIcon is rendered in the markup for MudColorPicker, MudDatePicker, MudDateRangePicker, and MudTimePicker. Also, align the ClearIcon parameter formatting in MudDateRangePicker.razor and MudPicker.razor for consistency. No functional changes to component logic.
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 9 out of 9 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.

@danielchalmers danielchalmers removed needs: tests A maintainer has explicitly asked for associated test cases to be added to this pull request needs: changes A maintainer has asked for further modifications to be made to this pull request labels Jan 13, 2026
@danielchalmers
Copy link
Member

Thank you!

This was referenced Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants