This is a migrated thread and some comments may be shown as answers.

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

4 Answers 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 17 Dec 2012, 06:02 PM
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.

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 19 Dec 2012, 12:40 PM
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.
0
William
Top achievements
Rank 1
answered on 22 Jan 2013, 07:14 PM
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.
0
Tom
Top achievements
Rank 1
answered on 23 Sep 2016, 09:25 AM
Has there been a solution to this problem when the fields our loaded dynamically?
0
Rumen
Telerik team
answered on 26 Sep 2016, 01:45 PM
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.
Tags
Editor
Asked by
Eric
Top achievements
Rank 1
Answers by
Rumen
Telerik team
William
Top achievements
Rank 1
Tom
Top achievements
Rank 1
Share this question
or