CodeBeamOrg / CodeBeam.MudBlazor.Extensions

Useful third party extension components for MudBlazor, from the contributors.
https://mudextensions.codebeam.org/
MIT License
371 stars 62 forks source link

MudStepper title error #154

Closed franklupo closed 1 year ago

franklupo commented 1 year ago

If the MudSteper is part of a MudDiaog and a step contains a MudDatagrid the title displayed is not corrected

"Edit" is displayed instead of "Fast configuration". If you comment MudDataGridEdit displays correctly

I created an example in https://trymudextensions.pages.dev/ but it doesn't generate the link

The source,

//main
<MudButton OnClick="ShowDialogFastConfig">Config</MudButton>

@code {
    [Inject] private IDialogService DialogService { get; set; } = default!;

    private void ShowDialogFastConfig()
    {
        DialogService.Show<DialogFastConfig>("Fast Configuration",
                                             new DialogOptions
                                             {
                                                 CloseButton = false,
                                                 DisableBackdropClick = true,
                                                 MaxWidth = MaxWidth.Medium,
                                                 FullWidth = true,
                                             });
    }
}
//DialogFastConfig.cs
<MudDialog Style="width:80%;">
    <DialogContent>
        <MudStepper MobileView="true" >
            <ChildContent>
                <MudStep Title="1">
                    <MudText>First</MudText>                    
                </MudStep>

                <MudStep Title="2" >
                    <DataGridEdit />

                </MudStep>

                <MudStep Title="Contact">
                    <MudTextField T="string" Required="true" />
                    <MudTextField T="string"  Required="true" />
                    <MudTextField T="string"  Required="true" />
                    <MudTextField T="string" Required="true" />
                    <MudTextField T="string"  Required="true" />
                </MudStep>

                <MudStep Title="Result Step" IsResultStep="true">
                    <div class="d-flex flex-column align-center justify-center" style="height: 200px">
                        <MudIconButton Icon="@Icons.Material.Filled.DoneAll" Size="Size.Large" Variant="Variant.Filled" Color="Color.Success" />
                        <MudText>Your configuration succesfully completed.</MudText>
                    </div>
                </MudStep>
            </ChildContent>
        </MudStepper>
    </DialogContent>
</MudDialog>
//DataGridEdito
@using System.Collections.Generic;

<MudDataGrid  T="Element"  Items="@Elements.Take(4)"  Bordered="true" Dense="true">
    <Columns>
        <Column T="Element" Field="Number" Title="Nr" IsEditable="false" />
        <Column T="Element" Field="Sign" />
        <Column T="Element" Field="Name" />       
        <Column T="Element" Field="Molar" Title="Molar mass" />
    </Columns>
</MudDataGrid>

@code {
  public class Element
    {
        public string Group { get; set; }
        public int Position { get; set; }
        public string Name { get; set; }
        public int Number { get; set; }

        public string Sign { get; set; }
        public double Molar { get; set; }

        public override string ToString()
        {
            return $"{Sign} - {Name}";
        }
    }

    private IEnumerable<Element> Elements = new List<Element>();
}

best regards

mckaragoz commented 1 year ago

I think its not about MudStepper. It look like MudDialog and MudDataGrid have communication problem.

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

With MudBlazor 6.1.10 MudDataGrid will have its final shape. Maybe we should try with the next release.