File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 14201420 return ;
14211421 }
14221422
1423+ if ( this . opts . openOnEnter === false && e . which === KEY . ENTER ) {
1424+ return ;
1425+ }
1426+
14231427 this . open ( ) ;
14241428
14251429 if ( e . which === KEY . ENTER ) {
14751479 }
14761480
14771481 if ( e . which === KEY . TAB || KEY . isControl ( e ) || KEY . isFunctionKey ( e )
1478- || e . which === KEY . ESC || e . which == KEY . ENTER ) {
1482+ || e . which === KEY . ESC ) {
1483+ return ;
1484+ }
1485+
1486+ if ( this . opts . openOnEnter === false && e . which === KEY . ENTER ) {
14791487 return ;
14801488 }
14811489
18071815 }
18081816
18091817 if ( e . which === KEY . TAB || KEY . isControl ( e ) || KEY . isFunctionKey ( e )
1810- || e . which === KEY . BACKSPACE || e . which === KEY . ESC || e . which === KEY . ENTER ) {
1818+ || e . which === KEY . BACKSPACE || e . which === KEY . ESC ) {
1819+ return ;
1820+ }
1821+
1822+ if ( this . opts . openOnEnter === false && e . which === KEY . ENTER ) {
18111823 return ;
18121824 }
18131825
22842296 $ . fn . select2 . defaults = {
22852297 width : "copy" ,
22862298 closeOnSelect : true ,
2299+ openOnEnter : true ,
22872300 containerCss : { } ,
22882301 dropdownCss : { } ,
22892302 containerCssClass : "" ,
You can’t perform that action at this time.
0 commit comments