Bug with RadEditor: RadEditor Steals Page Focus when in HTML Mode.

5 posts, 0 answers
  1. Eric
    Eric avatar
    37 posts
    Member since:
    Aug 2012

    Posted 17 Dec 2012 Link to this post

    Hello,

    I have this scenario,

    I have a page with multiple text boxes and Rad Editor is at the end of the page, If I set the EditModes property of the RadEditor to HTML then when the Page is Loaded the Rad Editor steals the Page Focus and scrolls to the end of the page, I noticed that this does Not happen in Design and Preview Modes only when I select HTML Mode, why is that? Is this a Bug? If so, is there a quick workaround to this?
    Thank you.

    TextBox1
    TextBox2
    TextBox3
    .
    .
    .
    RadEditor



    ---
    This was tested in Firefox, Crhome and IE and they all have the same problem.
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 19 Dec 2012 Link to this post

    Hi,

    Here is an example on how to set the focus on a textbox control for example placed at the beginning of the page:

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ID="RadEditor1"></telerik:radeditor>
    <script type="text/javascript">
    function OnClientLoad(editor, args)
    {
      setTimeout(function()
      {
         $get("TextBox1").focus();
       }, 100);
    }
    </script>

    You can use it in your scenario.


    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. William
    William avatar
    4 posts
    Member since:
    Jan 2013

    Posted 22 Jan 2013 Link to this post

    I am having similar issue, but regardless of which mode I am in.  I have reviewed previous work-around solutions in the forums but they all involve knowing which object needs to have focus and setting that in the OnClientLoad event handler for the RadEditor.  Our application is extremely dynamic and knowing the specific control name (client-side) to be handled in this fashion simply isn't possible, or practical.  I need to be able to set focus of an object server side and not have it hijacked (for lack of a better word) by the RadEditor.  This works fine if I set the enable property to False on RadEditor during postback, but that obviously isn't a desired goal.

    Any solution to this without a hardcoded work-around?

    Much appreciated in advance for the help.
  5. Tom
    Tom avatar
    3 posts
    Member since:
    Sep 2016

    Posted 23 Sep Link to this post

    Has there been a solution to this problem when the fields our loaded dynamically?
  6. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 26 Sep Link to this post

    Hello,

    RadEditor is focusing the content area on purpose and this cannot be prevented. 

    However, you can scroll the page at the desired location on the page using the solution provided in this StackOverflow thread: Scroll to a specific location on the page using JavaScript.

    Best regards,
    Rumen
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017