File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 763
763
this . position ( ) ;
764
764
765
765
766
- // select the first not disabled option or the filter input if available
766
+ // Set focus to the first selected (in single mode) or not disabled option or the filter input if available
767
+ var $firstSelected = ! o . multiple ? $container . find ( 'li>.ui-state-active' ) . first ( ) : [ ] ;
768
+ if ( $firstSelected . length ) {
769
+ $firstSelected . trigger ( 'mouseover' ) . trigger ( 'mouseenter' ) . find ( 'input' ) . trigger ( 'focus' ) ;
770
+ }
767
771
var filter = this . header . find ( ".ui-multiselect-filter" ) ;
768
772
if ( filter . length ) {
769
773
filter . first ( ) . find ( 'input' ) . trigger ( 'focus' ) ;
770
774
} else if ( this . labels . length ) {
771
- this . labels . filter ( ':not(.ui-state-disabled)' ) . eq ( 0 ) . trigger ( 'mouseover' ) . trigger ( 'mouseenter' ) . find ( 'input' ) . trigger ( 'focus' ) ;
775
+ if ( ! $firstSelected . length ) {
776
+ this . labels . filter ( ':not(.ui-state-disabled)' ) . eq ( 0 ) . trigger ( 'mouseover' ) . trigger ( 'mouseenter' ) . find ( 'input' ) . trigger ( 'focus' ) ;
777
+ }
772
778
} else {
773
779
this . header . find ( 'a' ) . first ( ) . trigger ( 'focus' ) ;
774
780
}
You can’t perform that action at this time.
0 commit comments