Unplanned
Last Updated: 10 Jan 2023 16:27 by Ricardo
Ricardo
Created on: 10 Jan 2023 16:27
Category: Window
Type: Bug Report
0
window not centered on screen after the initial show

The Window will not open in the center of the screen if it was already opened once and the page has been scrolled. It seems that the Window keeps opening at the same position initially was opened, hence it could open out of screen bounds.

Steps & Code for Reproduction

 

  1. Copy/Paste the Code from below and Load the page
  2. Click on the Button, the Window will open at the center
  3. Scroll toward the top of the page until the button is barely visible
  4. Click the button again. At this point, the Window will open out of the screen boundaries, in its initial position

 

Code

<style>
    .mydiv {
        margin: 2000px 100px;
    }
</style>

<telerik:RadWindow ID="RadWindow1" runat="server">
    <ContentTemplate>
        <h3>RadWindow1 Content</h3>
    </ContentTemplate>
</telerik:RadWindow>

<script>
    function ShowEditForm(sender, args) {
        var wnd = $find("<%= RadWindow1.ClientID %>");
        wnd.show();
    }
    Sys.Application.add_load(function () {
        setTimeout(function () {
            $telerik.$('.mydiv')[0].scrollIntoView();
        }, 100)
    });  
</script>

<div class="mydiv">
    <telerik:RadButton runat="server" ID="RadButton1" Text="OpenWindow" AutoPostBack="false" OnClientClicked="ShowEditForm" />
</div>

0 comments