FormField with TextBox Display Issue #983

Closed
opened 2026-01-29 17:47:17 +00:00 by claunia · 3 comments
Owner

Originally created by @idblew on GitHub (Sep 12, 2023).

Describe the bug
When the text box has a null or empty string value, the text of the form field fills the component

<RadzenFormField Style="width: 400px" Text="Search Value" Variant="Variant.Flat">
    <RadzenTextBox Value="" />
</RadzenFormField>

image

Expected behavior
The form field should display correctly when the value is null/empty

image

Originally created by @idblew on GitHub (Sep 12, 2023). **Describe the bug** When the text box has a null or empty string value, the text of the form field fills the component ``` <RadzenFormField Style="width: 400px" Text="Search Value" Variant="Variant.Flat"> <RadzenTextBox Value="" /> </RadzenFormField> ``` ![image](https://github.com/radzenhq/radzen-blazor/assets/16039175/11c30f3e-37a1-43f5-820e-0749abebd1cc) **Expected behavior** The form field should display correctly when the value is null/empty ![image](https://github.com/radzenhq/radzen-blazor/assets/16039175/38709a0a-752e-4be1-9e18-ab3342fe3edc)
Author
Owner

@idblew commented on GitHub (Sep 12, 2023):

Also, if a placeholder is defined this should display when there is no value

<RadzenFormField Style="width: 400px" Text="Search Value" Variant="Variant.Flat">
    <RadzenTextBox Placeholder="Search..." Value="" />
</RadzenFormField>
@idblew commented on GitHub (Sep 12, 2023): Also, if a placeholder is defined this should display when there is no value ``` <RadzenFormField Style="width: 400px" Text="Search Value" Variant="Variant.Flat"> <RadzenTextBox Placeholder="Search..." Value="" /> </RadzenFormField> ```
Author
Owner

@akorchev commented on GitHub (Sep 12, 2023):

Both behaviors you see are by design. The Text of the form field displays as a placeholder when the value of the component is empty. This is the main purpose of the component.

@akorchev commented on GitHub (Sep 12, 2023): Both behaviors you see are by design. The Text of the form field displays as a placeholder when the value of the component is empty. This is the main purpose of the component.
Author
Owner

@idblew commented on GitHub (Sep 15, 2023):

Managed to get this working using the following:

    <RadzenFormField Text="Search Value" Variant="Variant.Flat">
        <Start />
        <ChildContent>
            <RadzenTextBox class="rz-text-uppercase" MaxLength="50" Value=@SearchValue />
        </ChildContent>
        <End/>
    </RadzenFormField>

image

@idblew commented on GitHub (Sep 15, 2023): Managed to get this working using the following: ``` <RadzenFormField Text="Search Value" Variant="Variant.Flat"> <Start /> <ChildContent> <RadzenTextBox class="rz-text-uppercase" MaxLength="50" Value=@SearchValue /> </ChildContent> <End/> </RadzenFormField> ``` ![image](https://github.com/radzenhq/radzen-blazor/assets/16039175/0e1d195b-8904-4a45-9069-cbd8af496a80)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#983