RadzenFileInput Layout issue when used in RadzenFormField #1411

Closed
opened 2026-01-29 17:53:20 +00:00 by claunia · 1 comment
Owner

Originally created by @dave-gcv on GitHub (Sep 30, 2024).

I have noticed that there is a layout problem when using the RadzenFileInput inside a RadzenFormField under certain conditions:

Set Variant="Variant.Flat" on the RadzenFormField

This causes the field label to conflict with the file choose button. This is reproducable on the the demo page:
https://blazor.radzen.com/fileinput

<RadzenStack AlignItems="AlignItems.Center">
    <RadzenCard class="rz-m-0 rz-m-md-12" Style="width: 100%; max-width: 600px;">
        <RadzenFormField Text="File" Variant="Variant.Flat" AllowFloatingLabel="false" Style="width: 100%;">
        <RadzenFileInput @bind-Value=@photo @bind-FileName=@fileName @bind-FileSize=@fileSize TValue="byte[]" Style="width: 100%" 
            Change=@(args => OnChange(args, "FileInput")) Error=@(args => OnError(args, "FileInput")) InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "select file" }})"/>
    </RadzenFormField>
    </RadzenCard>
</RadzenStack>

image

This seems similar to issue #1654

Originally created by @dave-gcv on GitHub (Sep 30, 2024). I have noticed that there is a layout problem when using the RadzenFileInput inside a RadzenFormField under certain conditions: Set Variant="Variant.Flat" on the RadzenFormField This causes the field label to conflict with the file choose button. This is reproducable on the the demo page: https://blazor.radzen.com/fileinput ``` <RadzenStack AlignItems="AlignItems.Center"> <RadzenCard class="rz-m-0 rz-m-md-12" Style="width: 100%; max-width: 600px;"> <RadzenFormField Text="File" Variant="Variant.Flat" AllowFloatingLabel="false" Style="width: 100%;"> <RadzenFileInput @bind-Value=@photo @bind-FileName=@fileName @bind-FileSize=@fileSize TValue="byte[]" Style="width: 100%" Change=@(args => OnChange(args, "FileInput")) Error=@(args => OnError(args, "FileInput")) InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "select file" }})"/> </RadzenFormField> </RadzenCard> </RadzenStack> ``` ![image](https://github.com/user-attachments/assets/394fd7c1-cf87-454f-9461-04326d1b1342) This seems similar to issue #1654
Author
Owner

@yordanov commented on GitHub (Sep 30, 2024):

@dave-gcv, RadzenFormField is not designed to accommodate this specific scenario, yet you can use <RadzenFileInput Style="width: 100%; --rz-upload-button-bar-padding: 2rem 0.5rem 0.5rem;" until we have a proper fix.

@yordanov commented on GitHub (Sep 30, 2024): @dave-gcv, RadzenFormField is not designed to accommodate this specific scenario, yet you can use `<RadzenFileInput Style="width: 100%; --rz-upload-button-bar-padding: 2rem 0.5rem 0.5rem;"` until we have a proper fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1411