File tree 1 file changed +18
-2
lines changed 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,8 @@ $.extend(Selectize.prototype, {
164
164
keypress : function ( ) { return self . onKeyPress . apply ( self , arguments ) ; } ,
165
165
resize : function ( ) { self . positionDropdown . apply ( self , [ ] ) ; } ,
166
166
blur : function ( ) { return self . onBlur . apply ( self , arguments ) ; } ,
167
- focus : function ( ) { return self . onFocus . apply ( self , arguments ) ; }
167
+ focus : function ( ) { return self . onFocus . apply ( self , arguments ) ; } ,
168
+ paste : function ( ) { return self . onPaste . apply ( self , arguments ) ; }
168
169
} ) ;
169
170
170
171
$document . on ( 'keydown' + eventNS , function ( e ) {
@@ -361,6 +362,20 @@ $.extend(Selectize.prototype, {
361
362
this . $input . trigger ( 'change' ) ;
362
363
} ,
363
364
365
+
366
+ /**
367
+ * Triggered on <input> paste.
368
+ *
369
+ * @param {object } e
370
+ * @returns {boolean }
371
+ */
372
+ onPaste : function ( e ) {
373
+ var self = this ;
374
+ if ( self . isFull ( ) || self . isInputHidden || self . isLocked ) {
375
+ e . preventDefault ( ) ;
376
+ }
377
+ } ,
378
+
364
379
/**
365
380
* Triggered on <input> keypress.
366
381
*
@@ -451,7 +466,8 @@ $.extend(Selectize.prototype, {
451
466
self . deleteSelection ( e ) ;
452
467
return ;
453
468
}
454
- if ( self . isFull ( ) || self . isInputHidden ) {
469
+
470
+ if ( ( self . isFull ( ) || self . isInputHidden ) && ! ( IS_MAC ? e . metaKey : e . ctrlKey ) ) {
455
471
e . preventDefault ( ) ;
456
472
return ;
457
473
}
You can’t perform that action at this time.
0 commit comments