radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.61k stars 807 forks source link

Input from the keyboard freezes inside RadzenLayout #1399

Closed OndrejUzovic closed 8 months ago

OndrejUzovic commented 8 months ago

If you open a dialog window and inside that dialog window you open another dialog window and if closing that second dialog window closes also that first dialog window then reading the keyboard inside RadzenLayout will stop to work.

(Outside RadzenLayout the input from the keyboard keeps working.)

To reproduce the issue please perform following steps for the code bellow:

  1. Click the button 'Open to freeze it' - the first dialog window is open.
  2. Click the button 'Click to freeze' - the second dialog window is open.
  3. Click the button 'Ok' to close both dialogs.
  4. Error: it is not possible to write into the TextBox which is located inside RadzenLayout.

Here is a simple code to reproduce the issue:

@using Radzen;
@using Radzen.Blazor;

@inject DialogService myDialogService

<span>This TextBox will NOT freeze:</span>
<RadzenTextBox Style="width:5em;" />

<RadzenLayout Style="background-color: beige;">
    <RadzenBody>
        <span>This TextBox will freeze:</span>
        <RadzenTextBox />
        <RadzenButton Text="Open to freeze it" Click="@OnOpenClick" />
    </RadzenBody>
</RadzenLayout>

@code {
    private async Task OnOpenClick()
    {
        RenderFragment<DialogService> form = x =>
    @<div style="display:flex; flex-direction:column;">

        <RadzenButton Text="Click to freeze!" Click=@OnFreezeClick />
        <RadzenButton Text="Close" ButtonStyle="ButtonStyle.Secondary" Click="@(x => myDialogService.Close())" />
    </div>
        ;

        await myDialogService.OpenAsync("Title 1", form);
    }

    private async Task OnFreezeClick()
    {
        await myDialogService.Alert("When you click 'OK' it will not be possible to write into TextBox inside RadzenLayout.");
        myDialogService.Close();
    }
}

image

akorchev commented 8 months ago

Hi @OndrejUzovic,

Where should we put this code? What is in the layout? Ideally you can prepare a complete application.