@@ -136,7 +136,7 @@ $.extend(Selectize.prototype, {
136
136
137
137
$wrapper = $ ( '<div>' ) . addClass ( settings . wrapperClass ) . addClass ( classes ) . addClass ( inputMode ) ;
138
138
$control = $ ( '<div>' ) . addClass ( settings . inputClass ) . addClass ( 'items' ) . appendTo ( $wrapper ) ;
139
- $control_input = $ ( '<input type="text " autocomplete="new-password" autofill="no" />' ) . appendTo ( $control ) . attr ( 'tabindex' , $input . is ( ':disabled' ) ? '-1' : self . tabIndex ) ;
139
+ $control_input = $ ( '<input type="select-one " autocomplete="new-password" autofill="no" />' ) . appendTo ( $control ) . attr ( 'tabindex' , $input . is ( ':disabled' ) ? '-1' : self . tabIndex ) ;
140
140
$dropdown_parent = $ ( settings . dropdownParent || $wrapper ) ;
141
141
$dropdown = $ ( '<div>' ) . addClass ( settings . dropdownClass ) . addClass ( inputMode ) . hide ( ) . appendTo ( $dropdown_parent ) ;
142
142
$dropdown_content = $ ( '<div>' ) . addClass ( settings . dropdownContentClass ) . attr ( 'tabindex' , '-1' ) . appendTo ( $dropdown ) ;
@@ -191,10 +191,10 @@ $.extend(Selectize.prototype, {
191
191
self . $dropdown = $dropdown ;
192
192
self . $dropdown_content = $dropdown_content ;
193
193
194
- $dropdown . on ( 'mouseenter mousedown click' , '[data-disabled]>[data-selectable]' , function ( e ) { e . stopImmediatePropagation ( ) ; } ) ;
194
+ $dropdown . on ( 'mouseenter mousedown mouseup click' , '[data-disabled]>[data-selectable]' , function ( e ) { e . stopImmediatePropagation ( ) ; } ) ;
195
195
$dropdown . on ( 'mouseenter' , '[data-selectable]' , function ( ) { return self . onOptionHover . apply ( self , arguments ) ; } ) ;
196
- $dropdown . on ( 'mousedown click' , '[data-selectable]' , function ( ) { return self . onOptionSelect . apply ( self , arguments ) ; } ) ;
197
- watchChildEvent ( $control , 'mousedown ' , '*:not(input)' , function ( ) { return self . onItemSelect . apply ( self , arguments ) ; } ) ;
196
+ $dropdown . on ( 'mouseup click' , '[data-selectable]' , function ( ) { return self . onOptionSelect . apply ( self , arguments ) ; } ) ;
197
+ watchChildEvent ( $control , 'mouseup ' , '*:not(input)' , function ( ) { return self . onItemSelect . apply ( self , arguments ) ; } ) ;
198
198
autoGrow ( $control_input ) ;
199
199
200
200
$control . on ( {
@@ -208,7 +208,7 @@ $.extend(Selectize.prototype, {
208
208
keypress : function ( ) { return self . onKeyPress . apply ( self , arguments ) ; } ,
209
209
input : function ( ) { return self . onInput . apply ( self , arguments ) ; } ,
210
210
resize : function ( ) { self . positionDropdown . apply ( self , [ ] ) ; } ,
211
- blur : function ( ) { return self . onBlur . apply ( self , arguments ) ; } ,
211
+ // blur : function() { return self.onBlur.apply(self, arguments); },
212
212
focus : function ( ) { self . ignoreBlur = false ; return self . onFocus . apply ( self , arguments ) ; } ,
213
213
paste : function ( ) { return self . onPaste . apply ( self , arguments ) ; }
214
214
} ) ;
@@ -232,7 +232,8 @@ $.extend(Selectize.prototype, {
232
232
return false ;
233
233
}
234
234
// blur on click outside
235
- if ( ! self . $control . has ( e . target ) . length && e . target !== self . $control [ 0 ] ) {
235
+ // do not blur if the dropdown is clicked
236
+ if ( ! self . $dropdown . has ( e . target ) . length && e . target !== self . $control [ 0 ] ) {
236
237
self . blur ( e . target ) ;
237
238
}
238
239
}
@@ -664,12 +665,14 @@ $.extend(Selectize.prototype, {
664
665
665
666
if ( self . ignoreFocus ) {
666
667
return ;
667
- } else if ( ! self . ignoreBlur && document . activeElement === self . $dropdown_content [ 0 ] ) {
668
- // necessary to prevent IE closing the dropdown when the scrollbar is clicked
669
- self . ignoreBlur = true ;
670
- self . onFocus ( e ) ;
671
- return ;
672
668
}
669
+ // Bug fix do not blur dropdown here
670
+ // else if (!self.ignoreBlur && document.activeElement === self.$dropdown_content[0]) {
671
+ // // necessary to prevent IE closing the dropdown when the scrollbar is clicked
672
+ // self.ignoreBlur = true;
673
+ // self.onFocus(e);
674
+ // return;
675
+ // }
673
676
674
677
var deactivate = function ( ) {
675
678
self . close ( ) ;
0 commit comments