1. #1
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default do not select existing text in text field when focus via tab key

    do not select existing text in text field when focus via tab key


    When you CLICK into a textfield, if you want to select the existing text you might do something like this:
    PHP Code:
        fieldLabel'someLabel',
        
    name'someName',
        
    selectOnFocustrue,//select all of the existing text
        
    value'someValue' 
    The above works fine when you CLICK into the field. I haven't dug into the source yet, but it looks like Ext probably just listens to the focus event and if that setting is true it deselects the text (for a brief moment I can see the contents get selected then deselect).

    The problem: if you tab or shift+tab to gain focus it doesn't honor the selectOnFocus setting.

    Not sure if that's my mis-use, a bug, or the intended behavior.

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    does this happen in ie/fx too?

  3. #3
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    To reproduce problem in IE or firefox
    1. go here: http://extjs.com/deploy/dev/examples/form/dynamic.html
    2. In first field type in something.
    3. tab to next field
    4. Shift tab to go back to first field (for me it does select the existing content)
    5. Click on another field
    6. Now Click on the first field again (for me it does not select the existing content)

Thread Participants: 1