Declined
Last Updated: 09 Feb 2022 09:48 by ADMIN
Bert
Created on: 02 Feb 2022 22:00
Category: UI for Blazor
Type: Bug Report
0
Modal form, dialog behind screen

Maybe I'm doing it wrong...

I have a Telerik Window that is modal=true

Within the Telerik Window, I have a component... and within that component, other components.

I want to post a TelerikDialog.  "Do you want to save changes?"

If I add it to the component, it appears behind the main modal.

If I add it to the main Telerik Window, it doesn't appear at all.

How do you show a TelerikDialog on a TelerikWindow that is modal?

-Bert

1 comment
ADMIN
Hristian Stefanov
Posted on: 09 Feb 2022 09:48

Hi Bert,

There can be different reasons for the behavior. I tested the scenario with the code below. As a result, the dialog shows on top of the modal.

<TelerikWindow Modal="true" @bind-Visible="@isModalVisible">
    <WindowTitle>
        <strong>The Title</strong>
    </WindowTitle>
    <WindowContent>
        I am modal so the page behind me is not available to the user.
        <TelerikDialog @bind-Visible="@Visible"
                       Title="@Title">
            <DialogContent>
                A new version of <strong>Telerik UI for Blazor</strong> is available. Would you like to download and install it now?
            </DialogContent>
            <DialogButtons>
                <TelerikButton OnClick="@(() => { Visible = false; })">Skip this version</TelerikButton>
                <TelerikButton OnClick="@(() => { Visible = false; })">Remind me later</TelerikButton>
                <TelerikButton OnClick="@(() => { Visible = false; })" ThemeColor="primary">Install update</TelerikButton>
            </DialogButtons>
        </TelerikDialog>
        <TelerikButton OnClick="@(() => Visible = true)">Show Confirmation Dialog</TelerikButton>
    </WindowContent>
    <WindowActions>
        <WindowAction Name="Minimize" />
        <WindowAction Name="Maximize" />
        <WindowAction Name="Close" />
    </WindowActions>
</TelerikWindow>

<TelerikButton OnClick="@( _ => isModalVisible = true )">Open the window</TelerikButton>

@code {
    bool isModalVisible { get; set; } = true;
    private bool Visible { get; set; } = false;
    private string Title { get; set; } = "Software Update";
}

Make sure the Dialog is inside the Modal content. Please test the above code snippet to see if the result you get is the same.

I'm marking this public item as declined as the problem here is due to a misalignment of the components positions.

If the problem is still there, please send us a small runnable project that shows the behavior. This will allow me to investigate further and suggest next steps.

Thank you.

Regards,
Hristian Stefanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.