Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumericField: Add Clearable Parameter #3110

merged 2 commits into from
Dec 2, 2021


Copy link

@mckaragoz mckaragoz commented Oct 20, 2021


NumericField didn't have clearable parameter, because we can't add directly like TextField, needed some style to not overlapping spin buttons. With this PR, clearable added and set clearable icon's position to show them proper for each situation.

How Has This Been Tested?

It's a visually added feature, no change for clear method.

Types of changes

  • New feature (non-breaking change which adds functionality)

With spin buttons:

Ekran Görüntüsü (325)

Without spin buttons:

Ekran Görüntüsü (324)


  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests. (No need for test)

@JonBunator JonBunator added the enhancement New feature or request label Oct 21, 2021
Copy link

Choose a reason for hiding this comment

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

I don't like the duplicate code to be honest. Create a class via the CssBuilder builder. Then you can set the class based on some props.

protected string ClearButtonClassname =>
                    new CssBuilder()
                    .AddClass("mr-n1", Adornment == Adornment.End)

Copy link
Member Author

@mckaragoz mckaragoz Oct 21, 2021

Choose a reason for hiding this comment

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

I added some CssBuilder. Could you try it? There are lots of situations, im scared of missing some.

src/MudBlazor/Components/Input/MudInput.razor Outdated Show resolved Hide resolved
@henon henon changed the title NumericField: Adding Clearable Parameter NumericField: Add Clearable Parameter Dec 2, 2021
@henon henon merged commit ad693e0 into MudBlazor:dev Dec 2, 2021
Copy link

henon commented Dec 2, 2021


@mckaragoz mckaragoz deleted the NumericFieldClearable branch January 14, 2022 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
enhancement New feature or request
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants