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
merged 2 commits into from
Dec 2, 2021

Conversation

mckaragoz
Copy link
Member

@mckaragoz mckaragoz commented Oct 20, 2021

Description

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)

Checklist:

  • 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
Color="@Color.Default"
Icon="@ClearIcon"
Size="@Size.Small"
OnClick="@ClearButtonClickHandlerAsync"
Copy link
Member

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)
                    ....
                    .Build();

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
@henon
Copy link
Collaborator

henon commented Dec 2, 2021

Thanks!

@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
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants