CodeBeamOrg / CodeBeam.MudBlazor.Extensions

Useful third party extension components for MudBlazor, from the contributors.
https://mudextensions.codebeam.org/
MIT License
367 stars 62 forks source link

MudFileUpload triggered twice with MudLoadingButton #413

Open SpicyBoyd opened 3 weeks ago

SpicyBoyd commented 3 weeks ago

Bug type

Component

Component name

MudLoadingButton

What happened?

MudFileUpload triggered twice with MudLoadingButton

Expected behavior

MudFileUpload triggered once with MudLoadingButton

Reproduction steps

<MudFileUpload T="IBrowserFile" FilesChanged="UploadFiles">
    <ActivatorContent>
        <MudLoadingButton Loading="UploadLoading" 
                   Variant="Variant.Filled"
                   Color="Color.Primary"
                   StartIcon="@Icons.Material.Filled.CloudUpload">
            Upload Files
        </MudLoadingButton>
    </ActivatorContent>
</MudFileUpload>

Version (bug)

7.0.0-preview.4

What browsers are you seeing the problem on?

Chrome

On which operating systems are you experiencing the issue?

Windows

nvnd295 commented 2 weeks ago

I managed to fix it like this:

<MudButton HtmlTag="label" Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.CloudUpload"> Upload Files <MudFileUpload T="IBrowserFile" Accept=".xlsx" FilesChanged="UploadFile" MaximumFileCount="1"> </MudFileUpload> </MudButton>

so without the activator content and putting the fileupload inside the button. Don't know if it's the way to go though :)