Skip to content

Commit

Permalink
Upload should not raise change if file is not selected
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Oct 1, 2024
1 parent 8ac137f commit 765f5ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Radzen.Blazor/RadzenUpload.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ protected async System.Threading.Tasks.Task OnRemove(PreviewFileInfo file, bool
[JSInvokable("RadzenUpload.OnChange")]
public async System.Threading.Tasks.Task OnChange(IEnumerable<PreviewFileInfo> files)
{
if (files == null || !files.Any())
{
return;
}

this.files = files.ToList();

await Change.InvokeAsync(new UploadChangeEventArgs() { Files = files.Select(f => new FileInfo() { Name = f.Name, Size = f.Size }).ToList() });
Expand Down

0 comments on commit 765f5ac

Please sign in to comment.