TextField text select on focus Issue in Firefox

  1. #1

    TextField text select on focus Issue in Firefox

    Here is the code block on which I am facing issue on text select in textfield,

    var agetext = new Ext.form.TextField({
                                    width: 80,
                                    minLength: 1,
                                    allowBlank: false,
                                    selectOnFocus:true,
                                    validator: function (v) {
                                        return validateAgeOrDOB(v, true);
                                    },
                                    listeners: {
                                        change: function () {
                                            UpdateValues(this.getEl().id, this.getRawValue());
                                            this.container.addClass('x-grid3-dirty-cell');
                                        },
                                        render: function(cmp) 
                                            { 
                                              cmp.getEl().on('click',function(){
                                               this.dom.focus();
                                              });
                                             }
                                    },
                                    applyTo: 'ctl_' + i + '_' + j
                                });
                                fieldsToValidate += ',' + agetext.getEl().id;
    On removing selectOnFocus:true from above code,text in textfield not gets selected and on adding this selectOnFocus, cursor not showing in textfield.
    Last edited by rishu; Apr 04, 2012 at 5:30 AM.
  2. #2
    Hi,

    I was unable to reproduce.

    Example
    <%@ Page Language="C#" %>
    
    <%@ 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>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:TextField runat="server" Text="Hello World!" SelectOnFocus="true" />
        <ext:TextField runat="server" Text="Hello World!" SelectOnFocus="false" />
    </body>
    </html>
    Please provide your full test case.
  3. #3
    We are dynamically rendering textfield to gridPanel.Code in last posted thread was to render that text field to one of the column.When setting selectOnFocus property for textfield to true,it focuses the textfield and select whole text but cursor is not shown anywhere in the textfield on FF and IE both,e.g if textfield is having Date as text then we have to delete whole date to edit the text as cursor is not there in textfield.When removing this property Cursor is present in the textfield but not able to select text on focus on FF but it works fine on IE.
  4. #4
    Thanks for the details, but I still can't reproduce it.

    Please provide a sample to reproduce.

Similar Threads

  1. [CLOSED] Dynamically added Ext.Net.TextField doesn't get focus on left click in Firefox
    By gdg@abaksoftware.com in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jul 31, 2012, 7:45 AM
  2. [CLOSED] select number on focus
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 12, 2011, 3:16 PM
  3. Focus on Textfield
    By hans4 in forum 1.x Help
    Replies: 2
    Last Post: Jul 02, 2009, 9:08 PM
  4. Replies: 0
    Last Post: Jun 03, 2009, 3:14 PM
  5. [CLOSED] Select value of combobox on text change of textfield
    By Sharon in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 08, 2009, 7:00 AM

Posting Permissions