[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">
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
                    <ext:TextField runat="server" ID="EmailSubject" />
                    <ext:ComboBox Editable="false" runat="server" ID="EmailTokens">
    <ext:ListItem Text="InsertValue" Value="InsertValue"/>
    <ext:ListItem Text="InsertValue2" Value="InsertValue2"/>
                        <listeners><Select Handler="#{HtmlEditor1}.insertAtCursor(this.value);" /></listeners>
                <td colspan="2">
                    <ext:HtmlEditor ID="HtmlEditor1" AutoRender="true" AutoCreate="true" runat="server">
  2. #2

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


    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.


  4. #4

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


    The problem is fixed. Please update from SVN

    Here is original fix

    Last edited by geoffrey.mcgill; Nov 03, 2010 at 8:52 AM.
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

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

Posting Permissions