dist/toolkit.js
function(e) {
        if (!this.dropdown.is(':shown')) {
            return;
        }

        if ($.inArray(e.keyCode, [38, 40, 13, 27]) >= 0) {
            e.preventDefault();
        } else {
            return;
        }

        var options = this.element.find('option'),
            items = this.dropdown.find('a'),
            activeClass = 'is-active',
            index = this.index;

        switch (e.keyCode) {
            case 13: // enter
            case 27: // esc
                this.hide();
                return;
            case 38: // up
                index = this._loop(index, -1, options);
                break;
            case 40: // down
                index = this._loop(index, 1, options);
                break;
        }

        options.prop('selected', false);
        options[index].selected = true;

        items.parent().removeClass(activeClass);
        items.eq(index).parent().addClass(activeClass);

        this.index = index;
        this.element.change();
    }
function(e) {
        if (!this.dropdown.is(':shown')) {
            return;
        }

        if ($.inArray(e.keyCode, [38, 40, 13, 27]) >= 0) {
            e.preventDefault();
        } else {
            return;
        }

        var options = this.element.find('option'),
            items = this.dropdown.find('a'),
            activeClass = 'is-active',
            index = this.index;

        switch (e.keyCode) {
            case 13: // enter
            case 27: // esc
                this.hide();
                return;
            case 38: // up
                index = this._loop(index, -1, options);
                break;
            case 40: // down
                index = this._loop(index, 1, options);
                break;
        }

        options.prop('selected', false);
        options[index].selected = true;

        items.parent().removeClass(activeClass);
        items.eq(index).parent().addClass(activeClass);

        this.index = index;
        this.element.change();
    }
function ( e ) { if ( ! this . dropdown . is ( ':shown' ) ) { return ; } if ( $ . inArray ( e . keyCode , [ 38 , 40 , 13 , 27 ] ) >= 0 ) { e . preventDefault ( ) ; } else { return ; } var options = this . element . find ( 'option' ) , items = this . dropdown . find ( 'a' ) , activeClass = 'is-active' , index = this . index ; switch ( e . keyCode ) { case 13 : // enter case 27 : // esc this . hide ( ) ; return ; case 38 : // up index = this . _loop ( index , - 1 , options ) ; break ; case 40 : // down index = this . _loop ( index , 1 , options ) ; break ; } options . prop ( 'selected' , false ) ; options [ index ] . selected = true ; items . parent ( ) . removeClass ( activeClass ) ; items . eq ( index ) . parent ( ) . addClass ( activeClass ) ; this . index = index ; this . element . change ( ) ; }
Event handler for cycling through options with up and down keys.

@private
@param {jQuery.Event} e
Event handler for cycling through options with up and down keys .