pasteHtml issue, editor appears to lose focus?

2 posts, 0 answers
  1. DH
    DH avatar
    11 posts
    Member since:
    Dec 2011

    Posted 21 Sep 2015 Link to this post

    Having an issue with an editor. Fairly certain it is not control version related, as it is working fine in a radwindow. 

     Editor (shortened it)


    <telerik:RadEditor  ID="txtEditorBody" runat="server" Height="400px" Width="700px"   ContentAreaMode="Iframe" OnClientCommandExecuting="customTokens">
               <telerik:EditorToolGroup Tag="MainToolbar">
                   <telerik:EditorTool Name="AjaxSpellCheck" Visible="true" Enabled="true" />
                   <telerik:EditorSeparator />
               <telerik:EditorToolGroup Tag="Formatting">
                   <telerik:EditorTool Name="Bold" />
                   <telerik:EditorSeparator />
                   <telerik:EditorSplitButton Name="ForeColor">
                   <telerik:EditorSeparator />
                   <telerik:EditorDropDown Name="FontName">
                   <telerik:EditorDropDown Name="FontSize">
                   <telerik:EditorDropDown Name="Info" Width="50" Text="Info">
                       <telerik:EditorDropDownItem Name="First Name" Value=" %firstname% " />
           <TrackChangesSettings CanAcceptTrackChanges="False"></TrackChangesSettings>




    function customTokens(editor, args) {
        var name = args.get_name();
        var val = args.get_value();
        if (name == "Info") {


    It seems that when the page loads, the cursor is not visible in the editor. If you type in it, it then becomes visible. When you ensure the cursor is in the editor, and then click the custom drop down, the cursor leaves the editor. After you click the drop down item, nothing happens, and the cursor does not return to the window. Interestingly if you hi-light some text and then click the drop down item, it just removes the hilighted text instead of inserting the value. 

    Running a simple alert(name); and alert(val); shows that JS is pulling the correct info to insert, so the issue appears to be with editor.pastHtml()

    Even trying something simple like OnLoad and then attempting pasteHtml("Test") does not work.


  2. Joana
    Joana avatar
    210 posts

    Posted 25 Sep 2015 Link to this post

    Hi Dan,

    Let me summarize the issue and the desired behavior.
    1. You want the Editor to be focused when the page is loaded. This could be easily achieved as follows:
      function pageLoad() {
    2. It is expected that the cursor will leave the editor once a dropdown is clicked or any other tool. However, once the dropdown item is selected the cursor should return to the editor and the respective command for the dropdown should be executed. On my side, this is what I observe and I am not able to reproduce the described behavior. I have attached a video.

    Could you please give us more detailed information how to reproduce the issue:

    1. Is it browser specific?
    2. Are there any js errors that interrupt pasteHtml()?

    You could open a support thread and send us a runnable project where we'll examine the prerequisites for replicating the issue.

    I am looking forward to your reply.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top