Skip to content

bug(ButtonUpload): Selected Files Lost in ButtonUpload When Changing Steps in MultiStep Component (Blazor Server) #7696

@FrankAvendano

Description

@FrankAvendano

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Good morning @ArgoZhang,

I am currently using a ButtonUpload component within a Blazor Server (.NET 10) component. Additionally, within this view I am using a custom component called MultiStep, which changes the step index from the code-behind.

In the .razor file, I handle the rendering of each view corresponding to the steps using a switch statement, displaying the specific content according to the current index.

The issue I am experiencing is the following: all controls work correctly when changing steps, except for the ButtonUpload. When moving forward or changing the step, the previously selected files are reset and cleared.

I look forward to any guidance or recommendations to resolve this behavior.

Expected Behavior

The expected behavior is that the files selected in the ButtonUpload remain persistent when changing steps within the MultiStep component. In other words, when navigating forward or backward between the different steps, the previously uploaded information should not be reset or cleared unless an explicit action has been taken to clear or reset the control. This behavior should be maintained even when the component is re-rendered as the step changes, just as other controls such as select or input elements preserve their previously entered values or text.

Interactive render mode

Interactive Server (Interactive server-side rendering (interactive SSR) using Blazor Server)

Steps To Reproduce

Ok

Exceptions (if any)

No response

.NET Version

NET9.0

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions