Select-or-Die icon indicating copy to clipboard operation
Select-or-Die copied to clipboard

select is not updated on tabing

Open johanroug opened this issue 10 years ago • 1 comments

If hte dropdown is selected but not folded out, and I navigate with arrow keys, the select is not updated when I tab. Only when I click enter.

johanroug avatar Jan 08 '15 22:01 johanroug

It seems you can solve it like so

// Set $optionNext and $optionCycle if ( e.which === 37 || e.which === 38 ) { // Left/Up key console.log($optionActive) $optionNext = $optionActive.prevAll(":not('.disabled, .optgroup')").first(); $optionCycle = $sodOptions.not(".disabled, .optgroup").last();

                    if ( !$sod.hasClass("open") ) {
                        $optionNext.click();
                    }
                }
                else if ( e.which === 39 || e.which === 40 ) { // Right/Down key
                    $optionNext  = $optionActive.nextAll(":not('.disabled, .optgroup')").first();
                    $optionCycle = $sodOptions.not(".disabled, .optgroup").first();

                    if ( !$sod.hasClass("open") ) {
                        $optionNext.click();
                    }
                }

johanroug avatar Jan 08 '15 22:01 johanroug