You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: knowledge-base/predefined-dialog-beneath-modal-dialog-blazor.md
+30-37Lines changed: 30 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,18 +12,12 @@ ticketid: 1686792
12
12
## Environment
13
13
14
14
<table>
15
-
<tbody>
16
-
<tr>
17
-
<td>Product</td>
18
-
<td>
19
-
Dialog for Blazor
20
-
</td>
21
-
</tr>
22
-
<tr>
23
-
<td>Version</td>
24
-
<td>Current</td>
25
-
</tr>
26
-
</tbody>
15
+
<tbody>
16
+
<tr>
17
+
<td>Product</td>
18
+
<td>Dialog for Blazor</td>
19
+
</tr>
20
+
</tbody>
27
21
</table>
28
22
29
23
## Description
@@ -43,27 +37,29 @@ You can hide the close button of the main modal dialog via the `ShowCloseButton`
43
37
44
38
Or, you can apply a workaround to adjust the `z-index` of the predefined dialog.
45
39
46
-
### Using the `ShowCloseButton`Parameter
40
+
### Set `ShowCloseButton`to `false`
47
41
48
42
Set the `ShowCloseButton` parameter of the main modal dialog to `false`, and move the confirmation logic to a button within the modal dialog. This ensures the predefined dialog does not overlap with the modal.
bool isConfirmed = await Dialogs.ConfirmAsync("Are you sure?");
62
+
bool isConfirmed = await Dialogs!.ConfirmAsync("Are you sure?");
67
63
68
64
if (isConfirmed)
69
65
{
@@ -76,26 +72,28 @@ Set the `ShowCloseButton` parameter of the main modal dialog to `false`, and mov
76
72
}
77
73
}
78
74
}
79
-
```
75
+
````
80
76
81
-
### Workaround: Adjust the `z-index` Dynamically
77
+
### Adjust the `z-index` Dynamically
82
78
83
-
Use JavaScript to dynamically adjust the `z-index` of the predefined dialog. This ensures it appears above the modal dialog.
79
+
Use JavaScript to dynamically adjust the `z-index` of the predefined dialog. This ensures it appears above the modal dialog. The approach targets the dialog wrapper using CSS selectors and modifies its `z-index` style.
84
80
85
-
#### JavaScript Code
81
+
> This workaround relies on CSS selectors which may change in future updates of the Telerik theme. Use this approach with caution.
86
82
87
-
```javascript
88
-
<script suppress-error="BL9992">
89
-
functionbringDialogToTop() {
90
-
var dialogWrapper =document.querySelector(".k-window.k-dialog.k-alert.telerik-blazor").closest(".k-dialog-wrapper");
83
+
>caption JavaScript
84
+
85
+
````javascript.skip-repl
86
+
function bringDialogToTop() {
87
+
var dialogWrapper = document.querySelector(".k-window.k-dialog.k-alert").closest(".k-dialog-wrapper");
0 commit comments