File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2610,13 +2610,15 @@ the specific language governing permissions and limitations under the Apache Lic
26102610 selectedChoice = next . length ? next : null ;
26112611 }
26122612 else if ( e . which === KEY . BACKSPACE ) {
2613- this . unselect ( selected . first ( ) ) ;
2614- this . search . width ( 10 ) ;
2615- selectedChoice = prev . length ? prev : next ;
2613+ if ( this . unselect ( selected . first ( ) ) ) {
2614+ this . search . width ( 10 ) ;
2615+ selectedChoice = prev . length ? prev : next ;
2616+ }
26162617 } else if ( e . which == KEY . DELETE ) {
2617- this . unselect ( selected . first ( ) ) ;
2618- this . search . width ( 10 ) ;
2619- selectedChoice = next . length ? next : null ;
2618+ if ( this . unselect ( selected . first ( ) ) ) {
2619+ this . search . width ( 10 ) ;
2620+ selectedChoice = next . length ? next : null ;
2621+ }
26202622 } else if ( e . which == KEY . ENTER ) {
26212623 selectedChoice = null ;
26222624 }
@@ -2992,7 +2994,7 @@ the specific language governing permissions and limitations under the Apache Lic
29922994 this . opts . element . trigger ( evt ) ;
29932995
29942996 if ( evt . isDefaultPrevented ( ) ) {
2995- return ;
2997+ return false ;
29962998 }
29972999
29983000 while ( ( index = indexOf ( this . id ( data ) , val ) ) >= 0 ) {
@@ -3005,6 +3007,8 @@ the specific language governing permissions and limitations under the Apache Lic
30053007
30063008 this . opts . element . trigger ( { type : "select2-removed" , val : this . id ( data ) , choice : data } ) ;
30073009 this . triggerChange ( { removed : data } ) ;
3010+
3011+ return true ;
30083012 } ,
30093013
30103014 // multi
You can’t perform that action at this time.
0 commit comments