You can move a modal window past the bottom and out of view. At that point the only way to get back to it is to zoom out on the browser. Similarly, if you drag a window to the top, you can move it so high that the title bar is out of view. You can still see the bottom part of the window but even if you zoom out you can't get back to the title bar so the only thing you can do is to either escape out of the window or hope you have Ok/Cancel still visible.
---
ADMIN EDIT
Until a feature is implemented that can do this automatically (whether behind a flag like in our WebForms suite or not), you can handle the window events to check the Top and Left values and compare them with the viewport and the window size.
Here is a basic example:
<TelerikWindow Left="@TheLeft" Top="@TheTop" Draggable="true"
LeftChanged="@LeftChangedHandler" TopChanged="@TopChangedHandler"
Visible="true" Width="400px" Height="300px">
<WindowTitle>Drag me!</WindowTitle>
<WindowContent>When using Left and Top, make sure to update them in the view-model.</WindowContent>
<WindowActions>
<WindowAction Name="Minimize"></WindowAction>
<WindowAction Name="Maximize"></WindowAction>
</WindowActions>
</TelerikWindow>
@code{
string TheLeft { get; set; } = "50px";
string TheTop { get; set; } = "50px";
async Task LeftChangedHandler(string currLeft)
{
float leftValue = float.Parse(currLeft.Replace("px", ""));
Console.WriteLine("left " + leftValue);
//left boundary
if (leftValue < 0)
{
currLeft = "0px";
}
//right boundary - replace hardcoded values with current values from the viewport size
//and take into account the dimensions of your window. This sample hardcodes values for brevity and clarity
//you may find useful packages like this to get the viewport size https://www.nuget.org/packages/BlazorPro.BlazorSize/
if (leftValue > 1000)
{
currLeft = "1000px";
}
TheLeft = currLeft;
await DelayedRender();
}
async Task TopChangedHandler(string currTop)
{
float topValue = float.Parse(currTop.Replace("px", ""));
Console.WriteLine("top: " + topValue);
//top boundary
if (topValue < 0)
{
currTop = "0px";
}
//bottom boundary - replace hardcoded values with current values from the viewport size
//and take into account the dimensions of your window
if (topValue > 600)
{
currTop = "600px";
}
TheTop = currTop;
await DelayedRender();
}
async Task DelayedRender()
{
await Task.Run(async () =>
{
await Task.Delay(30);
await InvokeAsync(StateHasChanged);
});
}
}
---