Results 1 to 2 of 2

Thread: ComboBox selection with local filtering

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Sep 2009
    Posts
    21

    Exclamation ComboBox selection with local filtering

    Ext version tested:
    • Ext 5.1.1




    Browser versions tested against:
    • Chrome 45
    • IE11
    • Firefox 40




    Description:
    • When filtering a combobox, you can reach a state where you are unable to click on any of the list items. At that point, if you attempt to select via keyboard entry, it will select based on the index of the unfiltered store and pick the incorrect record.
    • I have a potential workaround that seems to help, but I'm not sure if it'll cause other issues along the way.
    • I noticed this in the kitchen sink example in 6.0.0 also, but I think it may have been cleared up in 6.0.1




    Steps to reproduce the problem:
    • This can be reproduced using the kitchen sink example: http://dev.sencha.com/extjs/5.1.0/ex...e-loaded-combo
    • Type "N" in the combobox.
    • Select "New Hampshire" by clicking the appropriate row.
    • Highlight the text from the combobox and Type "N" again.
    • When you get to the point where the list isn't displayed upon typing "N", delete "N" and try again.
    • This time, try clicking an item in the combobox and it likely will do nothing. It might take a couple attempts of filtering on the same letter and then deleting the text and trying again.
    • Also, once it gets stuck, if you navigate to the record with the keyboard and select something you'll get a completely different record! (i.e. selecting nevada will result in the selection of alaska)




    Potential Fix:
    Code:
    Ext.define('Ext.overrides.form.field.ComboBox', {
        override:'Ext.form.field.ComboBox',
    
    
        onFieldMutation: function(e) {
            var me = this,
                key = e.getKey(),
                isDelete = key === e.BACKSPACE || key === e.DELETE,
                rawValue = me.inputEl.dom.value,
                len = rawValue.length;
    
    
            // Do not process two events for the same mutation.
            // For example an input event followed by the keyup that caused it.
            // We must process delete keyups.
            // Also, do not process TAB event which fires on arrival.
            if (!me.readOnly && (rawValue !== me.lastMutatedValue || isDelete) && key !== e.TAB) {
                me.lastMutatedValue = rawValue;
                me.lastKey = key;
                if (len && (e.type !== 'keyup' || (!e.isSpecialKey() || isDelete))) {
                    me.doQueryTask.delay(me.queryDelay);
                } else {
                    // We have *erased* back to empty if key is a delete, or it is a non-key event (cut/copy)
                    if (!len && (!key || isDelete)) {
                        // Essentially a silent setValue.
                        // Clear our value, and the tplData used to construct a mathing raw value.
                        if (!me.multiSelect) {
                            me.value = null;
                            me.displayTplData = undefined;
                        }
                        // If the value is blank we can't have a value
                        if (me.clearValueOnEmpty) {
                            me.valueCollection.removeAll();
                        }
    
    
                        // Just erased back to empty. Hide the dropdown.
                        me.collapse();
    
    
                        // There may have been a local filter if we were querying locally.
                        // Clear the query filter and suppress the consequences (we do not want a list refresh).
                        if (me.queryFilter) {
                            // Must set changingFilters flag for this.checkValueOnChange.
                            // the suppressEvents flag does not affect the filterchange event
                            me.changingFilters = true;
                            me.store.removeFilter(me.queryFilter, true);
                            
                            // OVERRIDE!
                            me.getPicker().refresh();
                            delete me.lastQuery;
                        // END OVERRIDE!
                            
                            me.changingFilters = false;
                        }
                    }
                    me.callParent([e]);
                }
            }
        }
    });

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Hi jkelley,

    Can you put your example into a fiddle(https://fiddle.sencha.com) so we can review and diagnose with a Nightly build?


    Regards,
    Bryan

Similar Threads

  1. ComboBox RPC Loader, with local filtering?
    By jdkida in forum Sencha GXT Q&A
    Replies: 0
    Last Post: 15 Jun 2013, 8:40 AM
  2. Combobox with remote loading but local filtering
    By pouniok in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 28 Jan 2013, 1:51 PM
  3. [OPEN] Selection bug when using non-local filtering
    By zerkms in forum Ext:Bugs
    Replies: 1
    Last Post: 25 May 2012, 1:14 PM
  4. paging and filtering in a combobox with local proxy
    By markpele in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 23 Oct 2009, 12:41 AM
  5. Combobox Filtering (local)
    By DanGreen in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 27 Apr 2008, 4:06 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •