OnParentChanged still steals focus on hidden RadEditor

6 posts, 0 answers
  1. Erik
    Erik avatar
    28 posts
    Member since:
    Aug 2010

    Posted 01 Oct 2014 Link to this post

    Hi,

    I use the RadEditor inside a input form with dynamic content. Dependent of the selected record in a Radgrid different input control become visible. When an input control is not visible, its replaced to a seperate div to make room for other input controls. Because the RadEditor is replaced on the DOM I call editor.OnParentChanged() to let the RadEditor behave as expected especially in Firefox and IE 10 and lower. If I don't the RadEditor steals focus and its content becomes empty.

    This works great when the RadEditor becomes visible, but when the RadEditor becomes invisible it still steals the focus.This is a problem for pressed shortkeys in the RadGrid to navigate through records because they stop work after the focus is stolen. The content of the RadEditor stays filled when it is invisible as expected.

    The strange thing is, the focus is not stolen the first time the RadEditor becomes invisible.

    Any ideas what goes wrong in my situation?

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 06 Oct 2014 Link to this post

    Hello Erik,

    Using the OnParentNodeChange, automatic focusing of the editor is expected and it is the way this method is designed to act.

    This method is used to fix the editor when moved trough the DOM. It attaches all needed events with te core functionality and repaints the editor according the wrapper's size. Using it on an invisible editor is incorrect.

    Due to that I suggest redesigning the behavior by implementing a logic that calls the OnParentNodeChanged only when the editor is shown.  

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Erik
    Erik avatar
    28 posts
    Member since:
    Aug 2010

    Posted 06 Oct 2014 in reply to Ianko Link to this post

    Hi Lanko,

    "Using the OnParentNodeChange, automatic focusing of the editor is expected"
    This is not the behavior I notice when the control stays visible. That's one of the issues the OnParentNodeChange fixes in my case, because the user is not working with the editor at that moment so the focus should stay at the element the user is working with.

    I tried already not calling the OnParentNodeChanged when the RadEditor becomes invisible, but the RadEditor kept stealing focus.
    Can you provide me a solution for the problem I subscribed in my first post so the RadEditor won't steal the focus?
  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 06 Oct 2014 Link to this post

    Hi Erik,

    Could you please clarify some further matters on the implemented project, so that I could research further the encountered behavior?

    • Is the focus stolen when the page is loaded or after some user interaction?
    • How is the RadEditor control added to the grid?
    • Does the editor become visible/invisible via client-side logic  or server-side?

    Any additional informaiton on the matter will help me better understand the situation.

    Regards,

    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Erik
    Erik avatar
    28 posts
    Member since:
    Aug 2010

    Posted 06 Oct 2014 in reply to Ianko Link to this post

    Hi Ianko,

    "Is the focus stolen when the page is loaded or after some user interaction?"
    The focus is stolen after changing the selected row in the RadGrid. After user interaction.

    "How is the RadEditor control added to the grid?"
    The RadEditor is not added to the RadGrid, but underneath it displaying a value of the selected row in the RadGrid. Another column with checkboxes in the RadGrid is used to decide whether the RadEditor is visible or not.

    "Does the editor become visible/invisible via client-side logic  or server-side?"
    The RadEditor becomes invisible via client-side logic.

    Regards,
    Erik
  7. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 08 Oct 2014 Link to this post

    Hi Erik,

    I suggest modifying the way the RadEditor gets invisible. Try if setting the Visible property to false through code behind logic resolves the issue.

    If you still have difficulties with the matter, please provide a simple, isolated project that can be locally investigated to further examine the situation.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017