Fiddle:

https://fiddle.sencha.com/#fiddle/13nm

Ext version tested:

  • 5.1.2.748
  • 6.0.1.250

Browser versions tested against:
  • Chrome
  • Firefox
  • IE11

Description:
  • When doing a remote query in a combo box the picker is opened before query. So when the user types something and then hits enter too fast (because users are impatient), while the combo is still loading, the picker closes => the search results never show up.
    Looks like an empty search result to the user.

Steps to reproduce the problem:
  • Have an empty combo box
  • Click trigger (little arrow) to open picker. You can see if it is open by a tiny shadowy line below the combo input.
  • Hit enter.

The result that was expected:

  • Picker remains open because the user did not choose anything (yet).

The result that occurs instead:
  • Picker hides.


Fix:
Code:
Ext.define('Perbility.fix.view.BoundListKeyNav', {
    override: 'Ext.view.BoundListKeyNav',
    
    onKeyEnter: function(e) {
        var view = this.view,
            selModel = view.getSelectionModel(),
            field = view.pickerField,
            count = selModel.getCount();
            
        // Stop the keydown event so that an ENTER keyup does not get delivered to
        // any element which focus is transferred to in a select handler.
        e.stopEvent();
        this.selectHighlighted(e);

        // Handle the case where the highlighted item is already selected
        // In this case, the change event won't fire, so just collapse
        // BEGIN FIX
        // if (!field.multiSelect && count === selModel.getCount() && field.collapse) {
        if (!field.multiSelect && count === selModel.getCount() && field.collapse && this.getRecord()) {
        // END FIX
            field.collapse();
        }
    }
});