RadzenFormField Text not displaying properly #1708

Closed
opened 2026-01-29 17:57:32 +00:00 by claunia · 2 comments
Owner

Originally created by @Techoneshot on GitHub (Apr 11, 2025).

Describe the bug
I used to use <span> with class in FormField labels for required fields, now it stoped working. I have tried reverting version of Radzen Components but it looks like Radzen.js issue.

<style>
.required-field::after {
    content: "*";
    color: red;
    margin-left: 2px
}
</style>
    <RadzenFormField AllowFloatingLabel="false" Text="Test<span class='required-field'>Fixed label</span>" >
        <RadzenTextBox @bind-Value="@value" />
    </RadzenFormField>

@code {
    string value = "";
}

Expected behavior
Should render HTML used in Text as before

Screenshots
Before:
Image
After:
Image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: MS Edge
Originally created by @Techoneshot on GitHub (Apr 11, 2025). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** I used to use `<span>` with class in FormField labels for required fields, now it stoped working. I have tried reverting version of Radzen Components but it looks like Radzen.js issue. ``` <style> .required-field::after { content: "*"; color: red; margin-left: 2px } </style> <RadzenFormField AllowFloatingLabel="false" Text="Test<span class='required-field'>Fixed label</span>" > <RadzenTextBox @bind-Value="@value" /> </RadzenFormField> @code { string value = ""; } ``` **Expected behavior** Should render HTML used in Text as before **Screenshots** Before: ![Image](https://github.com/user-attachments/assets/0430f600-122e-4884-a5d4-5fa79af49728) After: ![Image](https://github.com/user-attachments/assets/c00cabf6-a1c5-441b-8288-ab64d9d2b55c) **Desktop (please complete the following information):** - OS: Windows 11 - Browser: MS Edge
Author
Owner

@akorchev commented on GitHub (Apr 11, 2025):

Indeed the Text property no longer accepts HTML strings. This is a new change introduced in Radzen.Blazor 6.4.0. You can use CSS to achieve the same effect without the extra markup

<style>
.required-field .rz-form-field-label::after {
    content: "*";
    color: red;
    margin-left: 2px
}
</style>
    <RadzenFormField AllowFloatingLabel="false" class="required-field" Text="Test" >
        <RadzenTextBox @bind-Value="@value" />
    </RadzenFormField>

@code {
    string value = "";
}
@akorchev commented on GitHub (Apr 11, 2025): Indeed the Text property no longer accepts HTML strings. This is a new change introduced in Radzen.Blazor 6.4.0. You can use CSS to achieve the same effect without the extra markup ``` <style> .required-field .rz-form-field-label::after { content: "*"; color: red; margin-left: 2px } </style> <RadzenFormField AllowFloatingLabel="false" class="required-field" Text="Test" > <RadzenTextBox @bind-Value="@value" /> </RadzenFormField> @code { string value = ""; } ```
Author
Owner

@Techoneshot commented on GitHub (Apr 11, 2025):

Thank you

@Techoneshot commented on GitHub (Apr 11, 2025): Thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1708