@@ -1510,6 +1510,34 @@ describe('ui-select tests', function() {
1510
1510
1511
1511
} ) ;
1512
1512
1513
+ it ( 'should stop the propagation when pressing ENTER key from dropdown' , function ( ) {
1514
+
1515
+ var el = createUiSelectMultiple ( ) ;
1516
+ var searchInput = el . find ( '.ui-select-search' ) ;
1517
+ spyOn ( jQuery . Event . prototype , 'preventDefault' ) ;
1518
+ spyOn ( jQuery . Event . prototype , 'stopPropagation' ) ;
1519
+
1520
+ triggerKeydown ( searchInput , Key . Down )
1521
+ triggerKeydown ( searchInput , Key . Enter )
1522
+ expect ( jQuery . Event . prototype . preventDefault ) . toHaveBeenCalled ( ) ;
1523
+ expect ( jQuery . Event . prototype . stopPropagation ) . toHaveBeenCalled ( ) ;
1524
+
1525
+ } ) ;
1526
+
1527
+ it ( 'should stop the propagation when pressing ESC key from dropdown' , function ( ) {
1528
+
1529
+ var el = createUiSelectMultiple ( ) ;
1530
+ var searchInput = el . find ( '.ui-select-search' ) ;
1531
+ spyOn ( jQuery . Event . prototype , 'preventDefault' ) ;
1532
+ spyOn ( jQuery . Event . prototype , 'stopPropagation' ) ;
1533
+
1534
+ triggerKeydown ( searchInput , Key . Down )
1535
+ triggerKeydown ( searchInput , Key . Escape )
1536
+ expect ( jQuery . Event . prototype . preventDefault ) . toHaveBeenCalled ( ) ;
1537
+ expect ( jQuery . Event . prototype . stopPropagation ) . toHaveBeenCalled ( ) ;
1538
+
1539
+ } ) ;
1540
+
1513
1541
it ( 'should increase $select.activeIndex when pressing DOWN key from dropdown' , function ( ) {
1514
1542
1515
1543
var el = createUiSelectMultiple ( ) ;
0 commit comments