Completed
Last Updated: 11 May 2020 09:28 by ADMIN
Release 2.13.0
Portia
Created on: 01 Oct 2019 22:21
Category: Window
Type: Bug Report
1
Modal Window is behind TreeView items and AnimationContainer

==============

Counter.razor:

==============

@page "/counter"

<h1>Counter</h1>

<p>Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

<button class="btn btn-danger" @onclick="OpenMiniWin">Open a kendo window</button>

<TelerikButton>Say Hello</TelerikButton>

<div>
    <ul>
        <li>All work and no play makes Jack a dull boy</li>
        <li>All work and no play makes Jack a dull boy</li>
        <li>All work and no play makes Jack a dull boy</li>
    </ul>
</div>


<Tree IsSpecialIcons="true"></Tree>

<TelerikWindow Modal="true" Visible="@isVisibleMiniWin">
    <WindowTitle>
        <strong>The Title</strong>
    </WindowTitle>
    <WindowContent>
        I am modal so the page behind me is not available to the user.
    </WindowContent>    
    <WindowActions>
        <WindowAction Name="Minimize" />
        <WindowAction Name="Maximize" />
        <WindowAction Name="Close" />
    </WindowActions>
</TelerikWindow>



@code {
    int currentCount = 0;
    bool isVisibleMiniWin = false;

    void IncrementCount()
    {
        currentCount++;
    }

    void OpenMiniWin()
    {
        isVisibleMiniWin = true;
    }
}

 

==============

Tree.razor:

==============

<TelerikTreeView Data="@FlatData" >
    <TreeViewBindings>
        <TreeViewBinding IdField="Id" ParentIdField="ParentIdValue" ExpandedField="Expanded" TextField="Text" HasChildrenField="HasChildren" IconField="Icon" />
    </TreeViewBindings>
</TelerikTreeView>

@code {
    public class TreeItem
    {
        public int Id { get; set; }
        public string Text { get; set; }
        public int? ParentIdValue { get; set; }
        public bool HasChildren { get; set; }
        public string Icon { get; set; }
        public bool Expanded { get; set; }
    }

    [Parameter]
    public bool IsSpecialIcons { get; set; } = false;

    public IEnumerable<TreeItem> FlatData { get; set; }

    protected override void OnInitialized()
    {
        LoadFlatData();
    }

    private void LoadFlatData()
    {
        List<TreeItem> items = new List<TreeItem>();

        items.Add(new TreeItem()
        {
            Id = 1,
            Text = "Project",
            ParentIdValue = null,
            HasChildren = true,
            Icon = "folder",
            Expanded = true
        });

        items.Add(new TreeItem()
        {
            Id = 2,
            Text = "Design",
            ParentIdValue = 1,
            HasChildren = true,
            Icon = "brush",
            Expanded = true
        });
        items.Add(new TreeItem()
        {
            Id = 3,
            Text = "Implementation",
            ParentIdValue = 1,
            HasChildren = true,
            Icon = "folder",
            Expanded = true
        });

        items.Add(new TreeItem()
        {
            Id = 4,
            Text = "site.psd",
            ParentIdValue = 2,
            HasChildren = false,
            Icon = "psd",
            Expanded = true
        });
        items.Add(new TreeItem()
        {
            Id = 5,
            Text = "index.js",
            ParentIdValue = 3,
            HasChildren = false,
            Icon = "js"
        });
        items.Add(new TreeItem()
        {
            Id = 6,
            Text = "index.html",
            ParentIdValue = 3,
            HasChildren = false,
            Icon = "html"
        });
        items.Add(new TreeItem()
        {
            Id = 7,
            Text = "styles.css",
            ParentIdValue = 3,
            HasChildren = false,
            Icon = "css"
        });

        FlatData = items;
    }
}

4 comments
ADMIN
Marin Bratanov
Posted on: 24 Dec 2019 08:41

To anyone having a similar situation, I am attaching here another workaround when a dropdownlist is involved (it also has a popup element that uses the animation container).

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Attached Files:
ADMIN
Marin Bratanov
Posted on: 02 Oct 2019 06:33

Hi Portia,

The treeview uses the AnimationContainer for its child items so it can provide the expand-collapse animation. So, it has a z-index and that z-index is actually higher than the z-index of the window, which is where the issue stems from. The window itself renders in the application root, not inside the treeview, the screenshots from the DOM is from items inside the tree and does not contain the window.

That said, I changed the title of this report to better reflect the problem and I have also logged it for fixing. You can click the Follow button on the portal page to get email notifications for status changes.

That said, here's a workaround:

<style>
    .k-dialog-wrapper {
        z-index: 100000;
    }
</style>

I'm attaching below a simple page that shows this workaround in action so you can easily test it as well.

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Attached Files:
Portia
Posted on: 01 Oct 2019 22:39

UI:

Portia
Posted on: 01 Oct 2019 22:38

See DOM... window div is actually inside one of the tree view list items.