Results 1 to 4 of 4

Thread: [FIXED][3.x/2.x SVN] BACKSPACE no longer triggers ComboBox#dqTask

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default [FIXED][3.x/2.x SVN] BACKSPACE no longer triggers ComboBox#dqTask

    EventObjectImpl.prototype.isSpecialKey() was recently fixed to detect the BACKSPACE key as a specialkey.

    this, however, suppresses the Combo's dqTask because the ComboBox#onKeyUp() method filters specialkeys, which in turn causes the combo list to not be filtered when the backspace key is pressed.

    the following override resolves the problem:
    (note: it also includes a fix suggested by condor for the "non-functional 'keyup' event" bug, which was reported here: http://extjs.com/forum/showthread.php?p=217782)
    Code:
    Ext.override(Ext.form.ComboBox, {
        onKeyUp: function(e) {
            var k = e.getKey();
        
            if (this.editable !== false && (k == e.BACKSPACE || !e.isSpecialKey())) {
                this.lastKey = k;
                this.dqTask.delay(this.queryDelay);
            }
    
            // *** 2.x/3.x bugfix for non-functional "keyup" event
            // *** by @condor -- https://www.sencha.com/forum/showthread.php?p=217782
            Ext.form.ComboBox.superclass.onKeyUp.call(this, e);
        },
    
        initEvents : function(){
            Ext.form.ComboBox.superclass.initEvents.call(this);
            this.keyNav = new Ext.KeyNav(this.el, {
                "up" : function(e){
                    this.inKeyMode = true;
                    this.selectPrev();
                },
                "down" : function(e){
                    if(!this.isExpanded()){
                        this.onTriggerClick();
                    }else{
                        this.inKeyMode = true;
                        this.selectNext();
                    }
                },
                "enter" : function(e){
                    this.onViewClick();
                    this.delayedCheck = true;
                    this.unsetDelayCheck.defer(10, this);
                },
                "esc" : function(e){
                    this.collapse();
                },
                "tab" : function(e){
                    this.onViewClick(false);
                    return true;
                },
                scope : this,
                doRelay : function(foo, bar, hname){
                    if(hname == 'down' || this.scope.isExpanded()){
                       return Ext.KeyNav.prototype.doRelay.apply(this, arguments);
                    }
                    return true;
                },
                forceKeyDown : true
            });
            this.queryDelay = Math.max(this.queryDelay || 10,
                    this.mode == 'local' ? 10 : 250);
            this.dqTask = new Ext.util.DelayedTask(this.initQuery, this);
            if(this.typeAhead){
                this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this);
            }
    
            // *** 2.x/3.x bugfix for non-functional "keyup" event
            // *** by @condor -- https://www.sencha.com/forum/showthread.php?p=217782
            if((this.editable !== false) && !this.enableKeyEvents) {
                this.el.on("keyup", this.onKeyUp, this);
            }
        }
    });
    i've also included a fix suggested by condor for the "non-functional 'keyup' event" bug, which was reported here: https://www.sencha.com/forum/showthread.php?p=217782.

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    Both fixes committed in both branches, thanks.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Location
    Brescia
    Posts
    60

    Default

    Hi all,
    sorry, but where do I add this script?

  4. #4
    Sencha - Services Team Stju's Avatar
    Join Date
    Dec 2008
    Location
    Redwood city, California
    Posts
    293

    Default

    @ladro1987. As evant stated on 11 Jun 2009 2:30 PM it's already fixed! Just download the latest version and You should be fine

Posting Permissions

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