RadzenHtmlEditor odd validator behavior

It seems that the RadzenHtmlEditor triggers the RadzenRequiredValidator before the input is registered.

If you load the page and input some text in the editor and hit tab. the Validator will trigger.

If you edit the text again and hit tab, it works as expected.

Is there a bug here?

@page "/cars"

<PageTitle>Car</PageTitle>

<h1>Car</h1>
<RadzenTemplateForm TItem="CarViewModel" Data="@Car" Submit="@FormSubmit">

    <RadzenRow style="margin-bottom: 1rem">
        <RadzenColumn SizeMD="3">
            <RadzenLabel Text="Description" Component="Description2" style="width: 100%" />
        </RadzenColumn>
        <RadzenColumn SizeMD="9">
            <RadzenHtmlEditor TItem="CarViewModel" @bind-Value=@Car.Description style="height: 250px;" Name="Description" Change="OnDescriptionChanged">
                <RadzenHtmlEditorUndo />
                <RadzenHtmlEditorRedo />
                <RadzenHtmlEditorSeparator />
                <RadzenHtmlEditorBold />
                <RadzenHtmlEditorItalic />
                <RadzenHtmlEditorUnderline />
                <RadzenHtmlEditorStrikeThrough />
                <RadzenHtmlEditorSeparator />
                <RadzenHtmlEditorColor />
                <RadzenHtmlEditorBackground />
                <RadzenHtmlEditorRemoveFormat />
            </RadzenHtmlEditor>
            <RadzenRequiredValidator Component="Description" Text="Description is required" />
        </RadzenColumn>
    </RadzenRow>


    <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End" Gap="0.5rem">
        <RadzenButton ButtonStyle="ButtonStyle.Primary" ButtonType="ButtonType.Submit" Icon="save" Text="Save" Variant="Variant.Flat" />
    </RadzenStack>

</RadzenTemplateForm>
@code {

    public class CarViewModel
    {
        public string Name { get; set; }
        public string Description { get; set; }
    }

    protected CarViewModel Car { get; } = new();

    private void OnDescriptionChanged(string html)
    {
        if (html == null)
        {
            html = "";
        }
    }
    
    protected async Task FormSubmit()
    {
        await Task.CompletedTask;
    }
}

Hi @KiloDunse,

Yes, this behavior is not normal. We will try to fix it with the next release of Radzen.Blazor.

1 Like