Skip to content

MudCsvMapper drag-and-drop area missing on MudBlazor 9.x #632

@nicobaoz

Description

@nicobaoz

It was there before, now not anymore – just the default upload button. I'm on the latest CodeBeam, MudBlazor, and .NET versions.

In your docs, it's there for some reason. When I copy the exact code on a fresh page, it's not there.

Claude says:

Probable cause

MudCsvMapper.razor builds its upload UI with the v8-era MudFileUpload activator slot:

<!-- src/.../Components/CsvMapper/MudCsvMapper.razor @ 87cae72 -->
<MudFileUpload T="IBrowserFile" Accept=".csv" OnFilesChanged="OnInputFileChanged" Hidden="false" ...>
    <ActivatorContent>
        ... cloud icon, "Choose File" MudFab, @LocalizedStrings.OrDragAndDrop ...
    </ActivatorContent>
</MudFileUpload>

But the project builds against MudBlazor 9.0.0 (CodeBeam.MudBlazor.Extensions.csproj). MudBlazor 9.x removed ActivatorContent and renders custom activators only via CustomContent (RenderFragment<MudFileUpload>):

// MudFileUpload<T>.BuildRenderTree, MudBlazor 9.x
if (CustomContent == null) {
    if (DragAndDrop) { /* built-in drag area */ }
    else            { /* default plain Upload button */ }   // ← rendered
} else {
    AddContent(CustomContent(this));
}

Since the component sets neither CustomContent nor DragAndDrop, the markup is silently discarded and MudFileUpload falls back to its default button.

Potential fixes

  • Migrate the internal MudFileUpload from ActivatorContent to CustomContent (RenderFragment<MudFileUpload>),
  • or set DragAndDrop="true" if the built-in drag area suffices,
  • or add a DragAndDrop parameter to the MudCsvMapper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions