Skip to content

fix: Submit action on form inside FluentWizardStep with DeferredLoading fire multiple times #3014

@Hwiet

Description

@Hwiet

🐛 Bug Report

When a FluentWizardStep with DeferredLoading contains a form with an submit callback (doesn't matter if it is passed to OnSubmit, OnValidSubmit, OnInvalidSubmit), the callback is fired multiple times, equal to the number of times the step was visited.

💻 Repro or Code Sample

GitHub repository here or recreate something that looks like this that makes it easy to see if a submit action is firing multiple times in a row. Then visit the DeferredLoading step multiple times.

<FluentWizard>
    <Steps>
        <FluentWizardStep Label="Intro">Intro</FluentWizardStep>

        <FluentWizardStep Label="Get started" DeferredLoading>
            <FluentEditForm Model="GetStartedModel" OnSubmit="@(() => ShowSubmitMessageAsync("GetStarted"))">
                GetStarted
            </FluentEditForm>
        </FluentWizardStep>

        <FluentWizardStep Label="Set budget">Set Budget</FluentWizardStep>
    </Steps>
</FluentWizard>

🤔 Expected Behavior

If a wizard step contains a form that has a submit callback, the callback should only be called once when going to the next step, whether or not the step has DeferredLoading or not.

😯 Current Behavior

When I revisit a step with DeferredLoading with a submit callback, the callback is called twice (or more if you keep revisiting the step)

🌍 Your Environment

  • OS & Device: Windows on PC
  • Browser: Microsoft Edge
  • .NET 9 and Fluent UI Blazor 4.10.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNew issue. Needs to be looked at

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions