https://blazorrepl.telerik.com/cGEHOxYU12TavfAP41
Dialog component does not recalculate its z-index based on the existing window components. Thus, it is displayed behind the window.
I have a Modal Window showing and then show a Predefined Dialog alert. You can click on the modal window and the Alert dialog goes behind and you have to close the modal, then close the alert dialog.
It would be nice if the the predefined dialogs were always modal on top of all windows.
Can I define the Cancel home button by default? When deleting a line I use Confirm Dialogs, I want the default (active) button to be Cancel (not Ok)
---
ADMIN EDIT
Here is a solution you can use:
@inject IJSRuntime _js
@* move this script to a proper place in your project and remove the
suppress-error hack that lets it stay in the component - it is here for brevity only *@
<script suppress-error="BL9992">
function focusCancelDialogButton() {
setTimeout(function() {
var cancelButtons = document.querySelectorAll(".k-dialog .k-dialog-buttongroup .k-button");
if(cancelButtons && cancelButtons.length > 1) {
cancelButtons[1].focus();
}
}, 100);
}
</script>
<TelerikButton OnClick="@ShowConfirm">Show Confirm</TelerikButton>
@code {
[CascadingParameter]
public DialogFactory Dialogs { get; set; }
public async Task ShowConfirm()
{
await _js.InvokeVoidAsync("focusCancelDialogButton");
bool isConfirmed = await Dialogs.ConfirmAsync("Are you sure?");
if (isConfirmed)
{
Console.WriteLine("The user is sure, continue.");
}
else
{
Console.WriteLine("The user changed their mind");
}
}
}
---