CodeBeam.MudBlazor.Extensions icon indicating copy to clipboard operation
CodeBeam.MudBlazor.Extensions copied to clipboard

Css not aligned with MudBlazor

Open antonKrizmanic opened this issue 1 year ago • 7 comments
trafficstars

It looks like some css margin/paddings are not aligned with mud blazor project. I think when 7.0.0 was published it was ok (but not 100% sure)

Setup MudBlazor version: 7.12.0 CodeBeam.MudBlazor.Extensions version: 7.0.2

Code example

<MudGrid>
    <MudItem lg="4">
<MudTextField @bind-Value="TextValue" Label="Outlined" Variant="Variant.Outlined"></MudTextField>
    </MudItem>
    <MudItem xs="12" sm="4" Class="d-flex gap-4">
        <MudSelectExtended MultiSelection="true" ItemCollection="_states" SearchBox="true" T="string" Label="Standard Search" Variant="Variant.Outlined" />        
    </MudItem>
</MudGrid>

@code {

    public string TextValue { get; set; }    

    private string[] _states =
    {
        "Alabama", "Alaska", "American Samoa", "Arizona",
        "Arkansas", "California", "Colorado", "Connecticut",
        "Delaware", "District of Columbia", "Federated States of Micronesia",
        "Florida", "Georgia", "Guam", "Hawaii", "Idaho",
        "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky",
        "Louisiana", "Maine", "Marshall Islands", "Maryland",
        "Massachusetts", "Michigan", "Minnesota", "Mississippi",
        "Missouri", "Montana", "Nebraska", "Nevada",
        "New Hampshire", "New Jersey", "New Mexico", "New York",
        "North Carolina", "North Dakota", "Northern Mariana Islands", "Ohio",
        "Oklahoma", "Oregon", "Palau", "Pennsylvania", "Puerto Rico",
        "Rhode Island", "South Carolina", "South Dakota", "Tennessee",
        "Texas", "Utah", "Vermont", "Virgin Island", "Virginia",
        "Washington", "West Virginia", "Wisconsin", "Wyoming",
    };

    private bool SearchItems(string value, string searchString)
    {
        if (searchString == "")
        {
            return true;
        }

        if (value.StartsWith(searchString, StringComparison.CurrentCultureIgnoreCase))
        {
            return true;
        }

        return false;
    }
}

Image image

antonKrizmanic avatar Oct 17 '24 16:10 antonKrizmanic

This is still an issue with MudBlazor 8.3.0. I would like to use multiple inputs, both MudSelectExtended and MudSelect, but it is not possible to put them into the same row because of the style differences. Is it planned to align the CSS with MudBlazor v8?

w3ori avatar Mar 20 '25 17:03 w3ori

For example the Typo is differend: subtitle1 vs body1

w3ori avatar Mar 24 '25 18:03 w3ori

It should be work with last release (8.1.0). Please re-open this issue if you see same problem.

mckaragoz avatar Apr 23 '25 06:04 mckaragoz

MudSelectExtended and MudSelect have different height in 8.1.0 when selection is cleared.

Image

@mckaragoz

w3ori avatar Apr 23 '25 07:04 w3ori

Well, i can't reproduce that, tried on an example and click the clear icon but the height remains same. Could you check it again?

mckaragoz avatar Apr 30 '25 13:04 mckaragoz

Well, i can't reproduce that, tried on an example and click the clear icon but the height remains same. Could you check it again?

Yes I will check on next week.

w3ori avatar Apr 30 '25 15:04 w3ori

Well, i can't reproduce that, tried on an example and click the clear icon but the height remains same. Could you check it again?

Try to paste this code.

Versions:

  • Mudblazor 8.6.0
  • CodeBeam.MudBlazor.Extensions 8.2.0

Image

<MudStack Row>
    <MudSelectExtended MultiSelection ItemCollection="_states" SearchBox="true" T="string" Label="Standard Search" AnchorOrigin="Origin.BottomCenter" Variant="Variant.Outlined" SearchBoxClearable Clearable />
    <MudDatePicker @bind-Date="@date" Variant="Variant.Outlined" Clearable/>
</MudStack>

<MudDivider Class="my-5"/>

<MudStack Row>
    <MudSelectExtended T="string" ItemCollection="_states"
                       Placeholder="Placeholder" Label="Label" SearchBoxPlaceholder="SearchBoxPlaceholder"
                       SearchBox="true" SearchBoxAutoFocus="true" MultiSelection="true" Clearable SelectAll SearchBoxClearable="true"
                       SelectAllText="Select all" AnchorOrigin="Origin.BottomCenter" Variant="Variant.Outlined"
                       MaxHeight="400">
    </MudSelectExtended>

    <MudDatePicker @bind-Date="@date" PickerVariant="PickerVariant.Dialog" Label="Label"
                   Placeholder="Placeholder" Variant="Variant.Outlined" Clearable />
</MudStack>

@code {
    DateTime? date = DateTime.Today;

    private string[] _states =
    {
        "Alabama", "Alaska", "American Samoa", "Arizona",
        "Arkansas", "California", "Colorado", "Connecticut",
        "Delaware", "District of Columbia", "Federated States of Micronesia",
        "Florida", "Georgia", "Guam", "Hawaii", "Idaho",
        "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky",
        "Louisiana", "Maine", "Marshall Islands", "Maryland",
        "Massachusetts", "Michigan", "Minnesota", "Mississippi",
        "Missouri", "Montana", "Nebraska", "Nevada",
        "New Hampshire", "New Jersey", "New Mexico", "New York",
        "North Carolina", "North Dakota", "Northern Mariana Islands", "Ohio",
        "Oklahoma", "Oregon", "Palau", "Pennsylvania", "Puerto Rico",
        "Rhode Island", "South Carolina", "South Dakota", "Tennessee",
        "Texas", "Utah", "Vermont", "Virgin Island", "Virginia",
        "Washington", "West Virginia", "Wisconsin", "Wyoming",
    };

}

On the first example the Label modifies the position. On the second, the height is different.

w3ori avatar May 05 '25 13:05 w3ori

@mckaragoz can you reproduce this?

w3ori avatar May 13 '25 18:05 w3ori

@mckaragoz can you reproduce this?

It's not a extension issue. It's about MudDatePicker. When you use the core MudSelect component, you have same visual problem.

<MudStack Row>
    <MudSelect MultiSelection T="string" Label="Standard Search" AnchorOrigin="Origin.BottomCenter" Variant="Variant.Outlined" Clearable>
        @foreach (var item in _states)
        {
            <MudSelectItem Value="@item">@item</MudSelectItem>
        }
    </MudSelect>
    <MudDatePicker @bind-Date="@date" Variant="Variant.Outlined" Clearable/>
</MudStack>

Could you check with the core component also?

mckaragoz avatar May 14 '25 12:05 mckaragoz

I tried with MudSelect, same problem. And in first row first MudSelectExtended the Label is not displayed until I select one, it is like a Placeholder.

Image

<MudStack Row>
    <MudSelectExtended MultiSelection ItemCollection="_states" SearchBox="true" T="string" Label="MudSelectExtended" AnchorOrigin="Origin.BottomCenter" Variant="Variant.Outlined" SearchBoxClearable Clearable />
    <MudSelect T="string" Clearable Variant="Variant.Outlined" Placeholder="MudSelect" />
    <MudDatePicker @bind-Date="@date" Variant="Variant.Outlined" Clearable/>
</MudStack>

<MudDivider Class="my-5"/>

<MudStack Row>
    <MudSelectExtended T="string" ItemCollection="_states"
                       Placeholder="Placeholder" Label="MudSelectExtended" SearchBoxPlaceholder="SearchBoxPlaceholder"
                       SearchBox="true" SearchBoxAutoFocus="true" MultiSelection="true" Clearable SelectAll SearchBoxClearable="true"
                       SelectAllText="Select all" AnchorOrigin="Origin.BottomCenter" Variant="Variant.Outlined"
                       MaxHeight="400">
    </MudSelectExtended>

    <MudSelect T="string" Clearable Variant="Variant.Outlined" Placeholder="MudSelect" Label="MudSelect" />

    <MudDatePicker @bind-Date="@date" PickerVariant="PickerVariant.Dialog" Label="MudDatePicker"
                   Placeholder="Placeholder" Variant="Variant.Outlined" Clearable />

</MudStack>

@code {
    DateTime? date = DateTime.Today;

    private string[] _states =
    {
        "Alabama", "Alaska", "American Samoa", "Arizona",
        "Arkansas", "California", "Colorado", "Connecticut",
        "Delaware", "District of Columbia", "Federated States of Micronesia",
        "Florida", "Georgia", "Guam", "Hawaii", "Idaho",
        "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky",
        "Louisiana", "Maine", "Marshall Islands", "Maryland",
        "Massachusetts", "Michigan", "Minnesota", "Mississippi",
        "Missouri", "Montana", "Nebraska", "Nevada",
        "New Hampshire", "New Jersey", "New Mexico", "New York",
        "North Carolina", "North Dakota", "Northern Mariana Islands", "Ohio",
        "Oklahoma", "Oregon", "Palau", "Pennsylvania", "Puerto Rico",
        "Rhode Island", "South Carolina", "South Dakota", "Tennessee",
        "Texas", "Utah", "Vermont", "Virgin Island", "Virginia",
        "Washington", "West Virginia", "Wisconsin", "Wyoming",
    };

}

w3ori avatar May 14 '25 14:05 w3ori

As i said it's a MudDatePicker problem, because other components (MudTextField, MudSelect etc.) compatible with each other.

So it's better that you open an issue in core library that send this MudSelect and MudDatePicker code with a try.mudblazor.com link.

I'm closing this issue currently. Thanks for the info. If there is something that MudSelect can do but MudSelectExtended can't, please tell.

mckaragoz avatar May 14 '25 15:05 mckaragoz

As i said it's a MudDatePicker problem, because other components (MudTextField, MudSelect etc.) compatible with each other.

So it's better that you open an issue in core library that send this MudSelect and MudDatePicker code with a try.mudblazor.com link.

I'm closing this issue currently. Thanks for the info. If there is something that MudSelect can do but MudSelectExtended can't, please tell.

I tried your suggestion, and placed both MudDatePicker and MudSelect into the same row on the try.mudblazor.com site and I don't see any height difference. I don't really see the MudDatePicker compatibility problem. Can you point it out a bit more? Thanks

https://try.mudblazor.com/snippet/mEmzapPSpUESzVuq

w3ori avatar May 14 '25 15:05 w3ori

Yes, it has different height with Placeholder. Lets investigate why.

mckaragoz avatar May 14 '25 16:05 mckaragoz

I'm sure it's my mistake, but I don't understand what you mean by 'height difference'. To me, they look the same height.

https://try.mudblazor.com/snippet/mEQpuflIqlNeUQVL

Image Image

w3ori avatar May 14 '25 17:05 w3ori

Try with MudSelectExtended with placeholder.

mckaragoz avatar May 14 '25 19:05 mckaragoz

I tested again, so the MudSelectExtended has a greater height.

Image

These two line makes some difference. I don't know what we should change, but these modifies the height.

Image

w3ori avatar May 15 '25 05:05 w3ori

Good catch. There was 2 bugs that one we fixed with previous release. This one is about placeholder and fixed also.

I added https://mudextensions.codebeam.org/visualtest (ghost) page that you can try with different visual options. Don't forget to refresh cache with ctrl+f5.

mckaragoz avatar May 15 '25 15:05 mckaragoz

Thanks for your quick help.

w3ori avatar May 15 '25 15:05 w3ori