File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ var Selectize = function($input, settings) {
2828 isCmdDown : false ,
2929 isCtrlDown : false ,
3030 ignoreFocus : false ,
31+ ignoreBlur : false ,
3132 ignoreHover : false ,
3233 hasOptions : false ,
3334 currentResults : null ,
@@ -156,7 +157,7 @@ $.extend(Selectize.prototype, {
156157 keypress : function ( ) { return self . onKeyPress . apply ( self , arguments ) ; } ,
157158 resize : function ( ) { self . positionDropdown . apply ( self , [ ] ) ; } ,
158159 blur : function ( ) { return self . onBlur . apply ( self , arguments ) ; } ,
159- focus : function ( ) { return self . onFocus . apply ( self , arguments ) ; }
160+ focus : function ( ) { self . ignoreBlur = false ; return self . onFocus . apply ( self , arguments ) ; }
160161 } ) ;
161162
162163 $document . on ( 'keydown' + eventNS , function ( e ) {
@@ -526,6 +527,14 @@ $.extend(Selectize.prototype, {
526527 self . isFocused = false ;
527528 if ( self . ignoreFocus ) return ;
528529
530+ // necessary to prevent IE closing the dropdown when the scrollbar is clicked
531+ if ( ! self . ignoreBlur && document . activeElement === self . $dropdown_content [ 0 ] ) {
532+ self . ignoreBlur = true ;
533+ self . onFocus ( e ) ;
534+
535+ return ;
536+ }
537+
529538 if ( self . settings . create && self . settings . createOnBlur ) {
530539 self . createItem ( false ) ;
531540 }
You can’t perform that action at this time.
0 commit comments