Skip to content

Commit 4c12aaf

Browse files
authored
Add troubleshooting about scrollbars and modality
1 parent b17ad6b commit 4c12aaf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

controls/window/troubleshooting/common-issues.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This article lists common issues and questions related to the **RadWindow** for
3232

3333
* [OnClientClose is not Fired](#onclientclose-is-not-fired)
3434

35+
* [Modal Overlay of RadWindow adds Scrollbars](#modal-overlay-of-radwindow-adds-scrollbars)
3536

3637
## General Troubleshooting
3738

@@ -141,3 +142,35 @@ There are two workarounds:
141142

142143
* set `DestryOnClose` to `false`
143144

145+
## Modal Overlay of RadWindow adds Scrollbars
146+
147+
Commonly, due to design requirments, the body or the form have additoinal relative parents or a CSS rule `margin: 0 auto;`. This causes the modal overlay to miscaulculate the DOM element for the modality and add additinal offset.
148+
149+
There are several workarounds you can consider implementing:
150+
151+
* Make sure that the `<body>` or the `<form>` are the offset parents of the modal overlay. Further custom decoration should be applied to the form's content so that not affect RadWindow and its modality.
152+
* Remove the scrollbars of the page when RadWindow opens and restore the when closed. Like in the example below:
153+
154+
**JavaScript**
155+
156+
var bodyOverflow = "";
157+
var htmlOverflow = "";
158+
function openRadWindow()
159+
{
160+
//store the overflow
161+
bodyOverflow = document.body.style.overflow;
162+
htmlOverflow = document.documentElement.style.overflow;
163+
//hide the overflow
164+
document.body.style.overflow = "hidden";
165+
document.documentElement.style.overflow = "hidden";
166+
var oWnd = window.radopen(null, "RadWindow1");
167+
oWnd.add_close(closeHandler);
168+
}
169+
170+
function closeHandler(sender, args)
171+
{
172+
//restore the overflow
173+
document.body.style.overflow = bodyOverflow;
174+
document.documentElement.style.overflow = htmlOverflow;
175+
sender.remove_close(closeHandler);
176+
}

0 commit comments

Comments
 (0)