You found a bug! We've classified it as EXTJS-10221 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    121
    Vote Rating
    0
    logicoteam is on a distinguished road

      0  

    Default Problems with focus on combobox in form

    Problems with focus on combobox in form


    We have a problem with comboboxes in forms.
    In a form we have a textfield and a combobox; when value is inserted in textfield and users passes to combo (blur event on textfield, focus on combo) a validation on textfield value is accomplished by a call to server.
    If validation result is not Ok, focus is programmatically returned to textfield.
    The problem is that at this point the textfield results focused, but combobox remains in a 'strange' condition of 'selected' (as we can see from border ...) and when the user tries to focus it, the focus event on it doesn't fire anymore ...
    Any suggestions on how to restore combo in 'unselected' condition ?

    test:

    Code:
    new Ext.form.Panel({
        renderTo : document.body,
        items    : [
            {
                xtype      : 'textfield',
                fieldLabel : 'Text'
            },
            {
                xtype        : 'combobox',
                fieldLabel   : 'Choose State',
                queryMode    : 'local',
                displayField : 'name',
                valueField   : 'abbr',
                store        : {
                    fields : ['abbr', 'name'],
                    data   : [
                        {"abbr" : "AL", "name" : "Alabama"},
                        {"abbr" : "AK", "name" : "Alaska"},
                        {"abbr" : "AZ", "name" : "Arizona"}
                    ]
                },
                listeners    : {
                    delay : 1000, //delay, simulate ajax
                    focus : function(field) {
                        var prevField = field.previousSibling();
    
                        prevField.focus();
                    }
                }
            }
        ]
    });
    Last edited by mitchellsimoens; 14 Jun 2013 at 7:27 AM. Reason: added test

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I'm going to open a bug for this as it looks like the combo isn't getting the blur detected to remove the x-form-focus class from the <input>
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    121
    Vote Rating
    0
    logicoteam is on a distinguished road

      0  

    Default


    Do You plan a patch for this bug ?

  4. #4
    Sencha User
    Join Date
    May 2011
    Posts
    15
    Vote Rating
    3
    Decoy Deluxe is on a distinguished road

      0  

    Default Related blur issue

    Related blur issue


    Yep - same issue here, looks to me that blur method does not remove
    Code:
    .x-form-trigger-wrap-focus
    from the parent correctly.

    Manually calling triggerBlur() on the combo obj fixes for me.

    Additionally, calling combo.focus() does not add
    Code:
    x-form-trigger-wrap-focus
    to the bodyEl <td>, so the combo border is blue but any text I enter is still dark-grey rather than black. clicking on another field then back into the combo results in correct behaviour.

    No fix for that yet...

  5. #5
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    121
    Vote Rating
    0
    logicoteam is on a distinguished road

      0  

    Default


    Is this bug still present in 4.2.2 version ?

Thread Participants: 2

Tags for this Thread