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

Stepper ActiveStepChanged index not change #155

Closed franklupo closed 1 year ago

franklupo commented 1 year ago

HI, i created a stepper and added ActiveStepChanged event. The index parameter not change.

<MudStepper  ActiveStepChanged="@ActiveStepChanged">
    <ChildContent>
        <MudStep Title="A" >
                    <MudTextField T="string" Label="Name"  />
        </MudStep>

        <MudStep Title="B" >
                    <MudTextField T="string" Label="Name1" />
        </MudStep>

        <MudStep Title="C" >
                    <MudTextField T="string" Label="Name2" />
        </MudStep>

        <MudStep Title="D" IsResultStep="true">
                    <div>Brao</div>
        </MudStep>

    </ChildContent>
    <ActionContent>
            <MudButton Color="Color.Secondary">Cancel</MudButton>
        <MudSpacer />
    </ActionContent>
</MudStepper>

<div>Index @Index</div>

@code {
    private int Index {get;set;}
    private void ActiveStepChanged(int index) => Index=index;
}

Best regards

franklupo commented 1 year ago

The event is called without index

https://github.com/CodeBeamOrg/CodeBeam.MudBlazor.Extensions/blob/0850fc8197418007ce52ff66b2caca692b1fc84b/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor.cs#L205

https://github.com/CodeBeamOrg/CodeBeam.MudBlazor.Extensions/blob/0850fc8197418007ce52ff66b2caca692b1fc84b/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor.cs#L253

mckaragoz commented 1 year ago

Good find, very basic mistake from me, thanks