-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.copilot-candidatefeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the futureFeatures related to the built in components we ship or could ship in the future
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
Currently, InputFile does not handle the cancel event in this scenario (#49148):
- Click on the file input.
- Select a file.
OnChangewill be invoked. - Click on the file input again.
- Click "Cancel" in the file selection window. The file input will be cleared, but
OnChangewill not be invoked, so the app still thinks a file is selected.
There hasn't been a way to handle this, as there was no signal from the browser about the dialog being canceled. However, there is now a cancel event that can be used.
Describe the solution you'd like
I would like to subscribe to the cancel event of the underlying <input type="file"> and invoke OnChange.Invoke(new()) with an empty list of files.
Additional context
Related issue: havit/Havit.Blazor#884
Related discussion: https://stackoverflow.com/a/76926836/4150304
S-Luiten, tomasautonet and campersauLapinskasL and Copilot
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.copilot-candidatefeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the futureFeatures related to the built in components we ship or could ship in the future