The described functionality listed on https://demos.telerik.com/blazor-ui/window/stacking-windows
"The Telerik Window component for Blazor provides stacking z-index functionality that brings to front the component any time it receives focus."
doesn't appear to be working in the demo. When the one window receives focus the z-index does not change. This appears to not work correctly in the demo either.
Michal, the issue was fixed recently together with a related regression.
A possible workaround is to increment the z-index of the second Window with JavaScript: https://blazorrepl.telerik.com/GIFckRYZ59obEEDL22
You were quick :)
, here is your modified repl, also reproducible:
https://blazorrepl.telerik.com/wSlQOHOt21VOkuik23
Hi Michal,
I reproduced the problem, no need to send a ticket. We will investigate and follow up.
Regards,
Dimo
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hello Dimo,
ok thanks, ill go with new ticket.
Its not randomly, its exact at "same" number of clicks.(after the second open-close-open-close)
Even your scenario is not "nested", you have side by side windows, in the markup. Image in at as component inside component inside component and so on. Iam minimized the reproducible scenario just on the 2 levels. Real number of nesting is N.
Hello Michal,
The described problem looks different and non-relevant to the original thread topic. It's best to open a separate ticket about the scenario and send us a runnable example that reproduces it. If the issue occurs randomly, it may be due to a race condition and/or the specific implementation.
I created the following test page, which works as expected. You can use it as a base:
@using Telerik.DataSource
@using Telerik.DataSource.Extensions
<TelerikGrid OnRead="@OnGridRead"
TItem="@SampleModel"
FilterMode="GridFilterMode.FilterRow"
Pageable="true"
Sortable="true">
<GridColumns>
<GridCommandColumn>
<GridCommandButton OnClick="@( () => WindowVisible1 = true)" Icon="@SvgIcon.Window" />
</GridCommandColumn>
<GridColumn Field="@nameof(SampleModel.Name)" />
<GridColumn Field="@nameof(SampleModel.Price)" />
<GridColumn Field="@nameof(SampleModel.Quantity)" />
</GridColumns>
</TelerikGrid>
<TelerikWindow @bind-Visible="@WindowVisible1"
Modal="true">
<WindowActions>
<WindowAction Name="Close" />
</WindowActions>
<WindowTitle>
1 Window Title 1
</WindowTitle>
<WindowContent>
<TelerikGrid OnRead="@OnGridRead"
TItem="@SampleModel"
FilterMode="GridFilterMode.FilterRow"
Pageable="true"
Sortable="true">
<GridColumns>
<GridCommandColumn>
<GridCommandButton OnClick="@( () => WindowVisible2 = true)" Icon="@SvgIcon.Window" />
</GridCommandColumn>
<GridColumn Field="@nameof(SampleModel.Name)" />
<GridColumn Field="@nameof(SampleModel.Price)" />
<GridColumn Field="@nameof(SampleModel.Quantity)" />
</GridColumns>
</TelerikGrid>
</WindowContent>
<WindowFooter>
<TelerikButton OnClick="@( () => WindowVisible1 = false )">Close</TelerikButton>
</WindowFooter>
</TelerikWindow>
<TelerikWindow @bind-Visible="@WindowVisible2"
Modal="true">
<WindowActions>
<WindowAction Name="Close" />
</WindowActions>
<WindowTitle>
2 Window Title 2
</WindowTitle>
<WindowContent>
2 Window Content 2
</WindowContent>
<WindowFooter>
<TelerikButton OnClick="@( () => WindowVisible2 = false )">Close</TelerikButton>
</WindowFooter>
</TelerikWindow>
@code {
private bool WindowVisible1 { get; set; }
private bool WindowVisible2 { get; set; }
private List<SampleModel> GridData { get; set; } = new();
private async Task OnGridRead(GridReadEventArgs args)
{
DataSourceResult result = await GridData.ToDataSourceResultAsync(args.Request);
args.Data = result.Data;
args.Total = result.Total;
args.AggregateResults = result.AggregateResults;
}
protected override void OnInitialized()
{
for (int i = 1; i <= 7; i++)
{
GridData.Add(new SampleModel()
{
Id = i,
Name = $"Name {i}",
GroupName = $"Group {i % 3 + 1}",
Price = Random.Shared.Next(1, 100) * 1.23m,
Quantity = Random.Shared.Next(0, 1000),
StartDate = DateTime.Now.AddDays(-Random.Shared.Next(60, 1000)),
IsActive = i % 4 > 0
});
}
}
public class SampleModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string GroupName { get; set; } = string.Empty;
public decimal Price { get; set; }
public int Quantity { get; set; }
public DateTime StartDate { get; set; }
public bool IsActive { get; set; }
}
}
Regards,
Dimo
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi,
seems like this bug is back in version 7.0.0. (blazor server .net 8.0)
Zindex is wrong(exactly at -1 level) ie :10006 vs 10007...
Detail is in video, but after FEW clicking, not at first 2 clicks.
Scenario - flow:
Grid 1>commanm button click-> open widnow 1- >Component A inside window 1
Component A->Grid 2->commanm button click-> open widnow 2- >Component B inside window 2
Or, siply said, nested windows like this:
<mainPage>
<TelerikWindow 1 @bind-Visible=W1>
...
<TelerikWindow 2 @bind-Visible=W2>
...
</TelerikWindow>
...
</TelerikWindow>
</mainPage
how to reproduce(what you have at video):
1) open window 1 from grid 1
2) open window 2 from grid 2 ***!! (error at 0:17 and 0:29)
3) close window 2 - ok
4) open window 2 from grid 2 - ok
3) close window 2 - ok
5) close window 1 - ok
goto 1)
Grid->OnRead
Doesnt matter if closing but ESC keyboard,cross at window header, or close at window footer
Crucial is closing and reopening whole "window tree" back 2 times.
Demo from here,
https://demos.telerik.com/blazor-ui/window/stacking-windows
is not the same scenario. Not a "real nested windows" - its windows side by side at layout.
What doesnt working as hotfix:
//W2= false;
//await Task.Delay(100);
W2= true;
//await Task.Delay(10);
//W2.Window_FocusIn();
//StateHasChanged();
Any ideas, what can help, or opening new ticket is required?
Hi Dimo,
Thank you for explaining the different scenarios and suggesting workarounds. I also appreciate you logging the public bug on my behalf.
Hi Rahul,
I observe the following behavior on our online demo:
Let me know if you are talking about a different scenario. In this case, please provide detailed steps to reproduce.
Regards,
Dimo
Progress Telerik
Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024
Hi Eric,
I'm facing similar issue in our live application. Still I'm seeing Demo page having same issue: https://demos.telerik.com/blazor-ui/window/stacking-windows.
In nested dialog box, we have treeview - during data binding modal window appearing behind the parent window and then once data loaded to treeview it's appearing in front.
Also, I reviewed sample code posted by Radko https://blazorrepl.telerik.com/QROvcUui47Ffzscp56 seems working fine. But in the real scinario it having issue as mentioned above.
Anyone please suggest work round on it. I'm using UI for Blazor version: 6.0.2
Hi Eric,
I can confirm that the functionality is working as expected, and the z-index style is correctly incremented each time a Window gains focus. However, there is indeed an issue, but it is due to the demo example itself. To be more specific, the z-index of each Window is overridden by a `.demo-window` selector. Now that you have brought this to our attention, we will update the demo, so the custom styling of the demo does not interfere with the demonstrated functionality - thank you for bringing it up.
I have also prepared an example, where the above-mentioned selector is removed, and the functionality can be tested: https://blazorrepl.telerik.com/QROvcUui47Ffzscp56
Regards, Radko Stanev Progress Telerik