Completed
Last Updated: 05 Mar 2026 21:35 by Paul
Release 8.0.0
Indira
Created on: 16 Jan 2025 07:32
Category: Dialog
Type: Bug Report
2
Telerik Dialog shows behind modal Window after second opening

When a Dialog is shown from a modal Window, the Dialog appears behind the Window on second opening.

Here is a test page with a workaround:

@inject IJSRuntime js

<TelerikButton OnClick="@( () => WindowVisible = true )">Show Window</TelerikButton>

<TelerikWindow @bind-Visible="@WindowVisible"
               Modal="true">
    <WindowActions>
        <WindowAction Name="Minimize" />
        <WindowAction Name="Close" />
    </WindowActions>
    <WindowTitle>
        Window Title
    </WindowTitle>
    <WindowContent>
        <p>Window Content</p>
        <TelerikButton OnClick="@OnShowDialogButtonClick">Show Dialog</TelerikButton>
    </WindowContent>
</TelerikWindow>

<TelerikDialog @bind-Visible="@DialogVisible"
               Width="300px"
               Class="dialog-on-window">
    <DialogTitle>
        Dialog Title
    </DialogTitle>
    <DialogContent>
        <p>Dialog Content</p>
    </DialogContent>
    <DialogButtons>
        <TelerikButton OnClick="@( () => OnDialogButtonClick(true) )">OK</TelerikButton>
    </DialogButtons>
</TelerikDialog>

<script suppress-error="BL9992">
    function bringDialogToTop() {
        var dialogWrapper = document.querySelector(".dialog-on-window").closest(".k-dialog-wrapper");
        if (dialogWrapper) {
            dialogWrapper.style.zIndex = parseInt(dialogWrapper.style.zIndex) + 2;
        }
    }
</script>

@code {
    private bool WindowVisible { get; set; }

    private bool DialogVisible { get; set; }

    private bool ShouldFocusDialog { get; set; }

    private void OnShowDialogButtonClick()
    {
        DialogVisible = true;
        ShouldFocusDialog = true;
    }

    private void OnDialogButtonClick(bool result)
    {
        DialogVisible = false;
    }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (ShouldFocusDialog)
        {
            ShouldFocusDialog = false;
            await Task.Delay(1);

            await js.InvokeVoidAsync("bringDialogToTop");
        }

        await base.OnAfterRenderAsync(firstRender);
    }
}

3 comments
Paul
Posted on: 05 Mar 2026 21:35
I can confirm that this isn't fixed. I'm using Telerik.UI.for.Blazor version 11.1.1, and I get sporadic "correct" behavior when calling a Confirm Dialog from within a Modal Window. In my case, I have a TelerikEditor in a TelerikWindow set with Modal="true". Above that TelerikEditor is a TelerikDropDownList. When a user selects an item from the list, an async call is made and text is populated in the editor. If there is already text in the editor when the user selects an item, a Confirm is called to ask the user if they really want to lose the text they currently have. About one out of every 15-20 tries the confirm will open correctly on top of the modal. This can be seen in the image below.

ADMIN
Hristian Stefanov
Posted on: 03 Mar 2025 19:36

Hi Max,

I confirm that this fix was introduced in our latest release, version 8.0.0. Here’s a REPL example running on the latest version demonstrating the scenario where the fix applies.

Regards,
Hristian Stefanov
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Max
Posted on: 28 Feb 2025 12:26
In what version is this fixed?