Duplicated
Last Updated: 02 Mar 2020 13:17 by ADMIN
Sten
Created on: 30 Oct 2019 10:03
Category: UI for Blazor
Type: Feature Request
0
Datepicker in modal with higher z-index than animation container...

Hi,

Ran in to an issue here. To avoid modals getting hidden behind animation containers, we use a class for a div and "wrap" the modal in providing it with a higher z-index than the animation container(s).

However, when using a DatePicker inside this module the calender will be hidden behind the modal (since it is in an animation container).

 

Any suggestion how to overcome this problem?

 

Thanks & br,

Sten

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
6 comments
Sten
Posted on: 30 Oct 2019 14:09

Thanks, that did the trick. However, I needed to also set a z-index on the window lower than 10002, to avoid the window and the DatePickers animation container having both 10002 as z-index.

Br,

Sten 

ADMIN
Marin Bratanov
Posted on: 30 Oct 2019 14:00

Hello Sten,

Here's a workaround for that:

 

<style>
    .animContainerClass {
        z-index: 10 !important;
    }
</style>

<TelerikAnimationContainer Width="1600px" Height="800px" Class="k-popup" ParentClass="animContainerClass" @ref="@myPopupRef">lorem ipsum</TelerikAnimationContainer>

<TelerikWindow Modal="true" Visible="true" Width="400px" Height="300px">
    <WindowContent>
        <TelerikDatePicker @bind-Value="@val"></TelerikDatePicker>
        <div style="background: yellow; height: 500px;"></div>
    </WindowContent>
    <WindowTitle><strong>Lorem ipsum</strong></WindowTitle>
</TelerikWindow>

@code {
    DateTime val { get; set; } = DateTime.Now.Date;
    TelerikAnimationContainer myPopupRef;
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        await myPopupRef.ShowAsync();
    }
}

I am closing this as a duplicate of the other item I linked initially, as this is where the z-index relationships between windows and animation containers are to be resolved. For anyone else finding this page - here's the link: https://feedback.telerik.com/blazor/1432348-modal-window-is-behind-treeview-items-and-animationcontainer.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Sten
Posted on: 30 Oct 2019 13:46

Well the problem is that we have an animation container "in the background" as well, and don't want that one to lay in front of our window. We are looking for a convenient way to provide the two different animation containers with different z-index, so that one lays behind the window and the other one in front. See attached Picture, if it makes any sense..

 

Br,

Sten 

Attached Files:
ADMIN
Marin Bratanov
Posted on: 30 Oct 2019 13:34

Hello Sten,

The animation container, already being in the window should be on top of it. Could you try my sample and see how it works for you? Can you reproduce the problem with it?

On classes for the dropdowns, please Vote and Follow this: https://feedback.telerik.com/blazor/1433654-component-specific-css-classes-and-ability-to-set-classes-per-instance.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Sten
Posted on: 30 Oct 2019 13:31

Hi Marin,

Thanks for your reply. Yes, the problem with modals hiding behind animation container we already solved by giving the window a higher z-index. This probles occurs when we, after that, wants to render a DatePicker in the modal. Simply put, we want the animation container used by the DatePickers calender view to have a even higher z-index than our modal/window, but still keeping our other animation containers in the background. 

As it seems, the DatePickers animation container does’nt have a specific class or anything else that we can use to customize the z-index..?

 

Br,

Sten 

ADMIN
Marin Bratanov
Posted on: 30 Oct 2019 13:14

Hi Sten,

The Window does not render in its place of declaration, it renders at the root of the app. We already have it logged for improvement because I also don't think that the animation container should have a higher z-index than a modal window, and you can track this here (it also offers a workaround to increase the z-index of windows): https://feedback.telerik.com/blazor/1432348-modal-window-is-behind-treeview-items-and-animationcontainer.

That said, since the animation container renders in its place of declaration, if the date picker is inside the window, you should not be experiencing issues. Here's the code I tried and at the end of this message you will find a screenshot of what I get so you can compare and see if I am missing something from your scenario.

<TelerikWindow Modal="true" Visible="true" Width="400px" Height="300px">
    <WindowContent>
        <TelerikDatePicker @bind-Value="@val"></TelerikDatePicker>
        <div style="background: yellow; height: 500px;"></div>
    </WindowContent>
    <WindowTitle><strong>Lorem ipsum</strong></WindowTitle>
</TelerikWindow>

@code {
    DateTime val { get; set; } = DateTime.Now.Date;
}

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor