[CLOSED] HtmlEditor insertAtCursor bug on IE in 8.2 and 1.0

  1. #1

    [CLOSED] HtmlEditor insertAtCursor bug on IE in 8.2 and 1.0

    It appears that inserting text using the client side insertAtCursor function doesn't work properly in IE instead it inserts the text at the beginning of the string for IE. This function is working for FF and Opera when I tested, unfortunately the majority of the users on this particular product use IE. I would like to have this working in 8.2 at least initially. Please let me know if this can be fixed or if there is a valid work around like detecting IE and using the selection.getRange() on an object.

    I'm using IE 8, please see the sample page below:

    Switch out the ResourceManager with ScriptManager for testing on 8.2. the result is the same though.

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
    </ext:ResourceManager>
    
        
               <table>
            <tr>
                <td>
                    Subject:
                </td>
                <td>
                    <ext:TextField runat="server" ID="EmailSubject" />
                </td>
            </tr>
            <tr>
                <td>
                    Tokens:
                </td>
                <td>
                    <ext:ComboBox Editable="false" runat="server" ID="EmailTokens">
                        <items>
    
    
    
    <ext:ListItem Text="InsertValue" Value="InsertValue"/>
    <ext:ListItem Text="InsertValue2" Value="InsertValue2"/>
    </items>
                        <listeners><Select Handler="#{HtmlEditor1}.insertAtCursor(this.value);" /></listeners>
                    </ext:ComboBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <ext:HtmlEditor ID="HtmlEditor1" AutoRender="true" AutoCreate="true" runat="server">
                    </ext:HtmlEditor>
                </td>
            </tr>
        </table>
    
    
    </form>
    </body>
    </html>
  2. #2

    RE: [CLOSED] HtmlEditor insertAtCursor bug on IE in 8.2 and 1.0

    Hi,

    Yes, it is known bug. IE doesn't maintain cursor position after focus loss
    HtmlEditor it is just DOM element which uses browser designer mode (modern browsers allow to switch elements to the edit mode (designer mode)). All editing functionality is in the browser's hands. Therefore it is very hard to fix such bugs (it is browser bug, not toolkit)


    I was not able to find any fix for it yet (on the ExtJS forum there are many topics about that problem but solution is not provided yet)


    I have one idea about the possible fix under IE but not sure yet about implementation (periodically save cusrsor position and restore it manually (not sure about this step, how to move cursor in the element under design mode) )
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: [CLOSED] HtmlEditor insertAtCursor bug on IE in 8.2 and 1.0



    Even though it looses focus it doesn't or shouldn't effect the underlying iframe's ability to retrieve cursor position, evidenced by bold/italic... etc buttons that find the text that is selected in the iframe and insert html before and after. I created a jscript html editor from scratch a few years ago that was integrated into the application (un-reusable) that was able to retrieve the cursor position from the iframe. I'll revisit it if I can get a chance to and see if I can't find and post a work around. Maybe the ext.js select list is interfering with it somehow, however the one in the HtmlEditor toolbar doesn't seem to have an issue.

    Thanks,

    Ryan
  4. #4

    RE: [CLOSED] HtmlEditor insertAtCursor bug on IE in 8.2 and 1.0

    Hi,

    The problem is fixed. Please update from SVN

    Here is original fix

    http://forums.ext.net/showthread.php...ll=1#post33579
    Last edited by geoffrey.mcgill; Nov 03, 2010 at 9:52 AM.
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] ListView with HtmlEditor -> HtmlEditor value is null
    By SouthDeveloper in forum 1.x Premium Help
    Replies: 8
    Last Post: Apr 17, 2012, 1:50 AM
  2. [CLOSED] HtmlEditor
    By ndotis in forum 1.x Premium Help
    Replies: 4
    Last Post: Dec 20, 2010, 10:23 PM
  3. [CLOSED] 8.2 HTMLEditor With Plugins
    By HOWARDJ in forum 1.x Premium Help
    Replies: 5
    Last Post: Sep 19, 2010, 6:18 PM
  4. [CLOSED] HtmlEditor
    By state in forum 1.x Premium Help
    Replies: 1
    Last Post: Sep 10, 2009, 6:21 PM
  5. [CLOSED] HtmlEditor
    By Timothy in forum 1.x Premium Help
    Replies: 7
    Last Post: Sep 23, 2008, 9:44 AM

Posting Permissions