File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -237,18 +237,15 @@ $.extend(Selectize.prototype, {
237237
238238 $document . on ( 'mousedown' + eventNS , function ( e ) {
239239 if ( self . isFocused ) {
240- // prevent events on the dropdown scrollbar from causing the control to blur
241- if ( e . target === self . $dropdown [ 0 ] || e . target . parentNode === self . $dropdown [ 0 ] ) {
240+ // prevent events on the dropdown from causing the control to blur
241+ if (
242+ e . target === self . $dropdown [ 0 ] ||
243+ self . $dropdown . has ( e . target ) . length )
244+ {
242245 return false ;
243246 }
244247 // blur on click outside
245- // do not blur if the dropdown is clicked
246- if ( self . $dropdown . has ( e . target ) . length ) {
247- self . ignoreBlur = true ;
248- window . setTimeout ( function ( ) {
249- self . ignoreBlur = false ;
250- } , 0 ) ;
251- } else if ( e . target !== self . $control [ 0 ] ) {
248+ if ( e . target !== self . $control [ 0 ] ) {
252249 self . blur ( e . target ) ;
253250 }
254251 }
@@ -691,10 +688,6 @@ $.extend(Selectize.prototype, {
691688 onBlur : function ( e , dest ) {
692689 var self = this ;
693690
694- if ( self . ignoreBlur ) {
695- return ;
696- }
697-
698691 if ( ! self . isFocused ) return ;
699692 self . isFocused = false ;
700693
You can’t perform that action at this time.
0 commit comments