[FIXED] [#884] [3.3] RightButtonsShowMode set to focus moves caret to the first position

  1. #1

    [FIXED] [#884] [3.3] RightButtonsShowMode set to focus moves caret to the first position

    On Internet Explorer, click on TextField after the end of the text (Ext.Net): the caret is moved to the first position.

    Note: you may need to focus / unfocus more than once to reproduce the issue.

    <!DOCTYPE html>
    <html>
    <head runat="server">
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:TextField Text="Ext.Net" RightButtonsShowMode="Focus" FieldLabel="Field 001" runat="server">
            <RightButtons>
                <ext:Button Icon="Lightning" runat="server" />
            </RightButtons>
        </ext:TextField>
    </body>
    </html>
    Last edited by Daniil; Sep 10, 2015 at 8:54 AM. Reason: [FIXED] [#884] [3.3]
  2. #2
    Hi @RCN,

    Thank you for the report! I will investigate if we can do anything here.

    Created an Issue:
    https://github.com/extnet/Ext.NET/issues/884
    Last edited by Daniil; Aug 28, 2015 at 10:56 AM.
  3. #3
    Please try this override:
    Ext.form.field.Text.override({
        updateFieldPadding: function () {
            if (this.bulkButtonsUpdate) {
                this.needUpdateAfterBulk = true;
                return;
            }
    
            var field = this,
                pad,
                w,
                inputEl,
                inputElDom,
                updateValue,
                selectionStart,
                selectionEnd;
    
            if (field.leftButtons || field.rightButtons) {
                if (!field.isButtonsInit) {
                    field.initButtons(false);
                }
    
                inputEl = field.inputEl;
    
                if (field.leftButtonsCt) {
                    pad = inputEl.getPadding("l");
                    w = field.leftButtonsCt.getWidth() + 3;
    
                    if (pad != w) {
                        inputEl.setStyle("padding-left", w + "px");
                        updateValue = true;
                    }
                }
    
                if (field.rightButtonsCt) {
                    pad = inputEl.getPadding("r");
                    w = field.rightButtonsCt.getWidth() + 3;
    
                    if (pad != w) {
                        inputEl.setStyle("padding-right", w + "px");
                        updateValue = true;
                    }
                }
    
                if (updateValue) {
                    inputElDom = inputEl.dom;
    
                    if (Ext.isIE) { // #884
                        selectionStart = inputElDom.selectionStart;
                        selectionEnd = inputElDom.selectionEnd;
                    }
    
                    inputElDom.value = inputElDom.value;
    
                    if (Ext.isIE && inputElDom.setSelectionRange) { // #884
                        inputElDom.setSelectionRange(selectionStart, selectionEnd);
                    }
                }
            }
        }
    });
  4. #4
    It has been fixed in the revision 6557 (trunk). It goes to the 3.3 release.

Similar Threads

  1. Replies: 2
    Last Post: Jul 10, 2014, 2:37 PM
  2. [CLOSED] Dropdown without Caret (mouse pointer)
    By RajivDutt in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 06, 2014, 5:47 PM
  3. Replies: 1
    Last Post: Mar 19, 2012, 4:42 PM
  4. FormPanel that moves the load data
    By threewonders in forum 1.x Help
    Replies: 0
    Last Post: Feb 25, 2011, 8:48 AM
  5. Replies: 0
    Last Post: Jul 10, 2010, 2:13 PM

Posting Permissions