Auto focus to HtmlEditor still not working in dialog with AutoFocusFirstElement #651

Closed
opened 2026-01-29 17:40:56 +00:00 by claunia · 0 comments
Owner

Originally created by @OndrejUzovic on GitHub (Nov 22, 2022).

It looks the fix for the bug #714 is still not working in Radzen 4.3.7.

Please check to open the dialog in the following example:

@page "/"

@using Radzen;
@using Radzen.Blazor;

@inject DialogService DialogService

<div style="width:700px; height:500px; background-color:beige;">

    <RadzenCard>
        <RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Inline Dialog</RadzenText>
        <RadzenButton Text="Dialog with inline Blazor content" Style="width: 100%;" ButtonStyle="ButtonStyle.Secondary" Click=@ShowInlineDialog />
    </RadzenCard>


</div>

@code {

    async Task ShowInlineDialog()
    {
        var dialogOptions = new DialogOptions()
        {
            AutoFocusFirstElement = true,
            Width = "50%",
            Draggable = true,
        };

        await DialogService.OpenAsync("Simple Dialog", ds =>
        @<div style="display:grid;">
            <RadzenHtmlEditor TabIndex="1" />
            <RadzenHtmlEditor TabIndex="2" />
            <RadzenTextBox TabIndex="3" />
            <RadzenTextBox TabIndex="4" />
        </div>, dialogOptions);
    }
}

image

Or maybe, is there something wrong in that example code?

Originally created by @OndrejUzovic on GitHub (Nov 22, 2022). It looks the fix for the bug #714 is still not working in Radzen 4.3.7. Please check to open the dialog in the following example: ``` @page "/" @using Radzen; @using Radzen.Blazor; @inject DialogService DialogService <div style="width:700px; height:500px; background-color:beige;"> <RadzenCard> <RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Inline Dialog</RadzenText> <RadzenButton Text="Dialog with inline Blazor content" Style="width: 100%;" ButtonStyle="ButtonStyle.Secondary" Click=@ShowInlineDialog /> </RadzenCard> </div> @code { async Task ShowInlineDialog() { var dialogOptions = new DialogOptions() { AutoFocusFirstElement = true, Width = "50%", Draggable = true, }; await DialogService.OpenAsync("Simple Dialog", ds => @<div style="display:grid;"> <RadzenHtmlEditor TabIndex="1" /> <RadzenHtmlEditor TabIndex="2" /> <RadzenTextBox TabIndex="3" /> <RadzenTextBox TabIndex="4" /> </div>, dialogOptions); } } ``` ![image](https://user-images.githubusercontent.com/55758368/203278062-d5100fce-d4e1-4095-9565-23d51b6c242b.png) Or maybe, is there something wrong in that example code?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#651