RadWindow moves to the top upon close

4 posts, 0 answers
  1. Raheel Ashraf
    Raheel Ashraf avatar
    13 posts
    Member since:
    Mar 2010

    Posted 15 Jul 2010 Link to this post

    I open a modal rad window as popup and while opening through javascript, i use to MoveTo api to move to it to the centre of the screen. On the window, I have a button called close, which on click, executes close() on the window, but to my surprise, when the window is closed, the other window that opened it, scrolls to the top..
    when i looked in detail, the radwindow had some default close event handler, which uses some "_focusedPageElement" and focuses on it,, in my case _focusedPageElement was referring to the iframe of the window that opened the popup..
    why is that?? how can i prevent that?
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 15 Jul 2010 Link to this post

    Hi Raheel Ashraf,

    Indeed, the reason for this behavior is the moving of the focus and this is not directly related to RadControls but can be also reproduced with standard HTMl elements. You can find a detailed workaround on how to resolve this problem (which occurs only under IE and is related to browser specific behavior):

    http://www.telerik.com/support/kb/aspnet-ajax/window/persist-radwindow-s-scroll-position.aspx

    All the best,
    Svetlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Raheel Ashraf
    Raheel Ashraf avatar
    13 posts
    Member since:
    Mar 2010

    Posted 15 Jul 2010 Link to this post

    thanks for the link..however, what value to set for the timeout..in the example it is 30ms, but if i remember, the default close handler for radwindow, also does a timeout and in that, it sets the focus..so is 30 a safe number then?
  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 20 Jul 2010 Link to this post

    Hi Raheel Ashraf,

    You are correct that when a radWindow is modal, it resets the focus by using a small timeout of 10ms /this is not the case with non modal RadWindow, it does not change focus at all and no timeout is used there so it is not correct to say that the default  close handler uses a timeout /. Since there is only the 10ms timeout, using 30ms should be safe enough and we have also not been contacted with reports for problems with that.

    Greetings,
    Svetlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top