@@ -63,7 +63,7 @@ var Selectize = function($input, settings) {
6363 self . registerOption ( self . settings . options [ i ] ) ;
6464 }
6565 delete self . settings . options ;
66- }
66+ }
6767
6868 // build optgroup table
6969 if ( self . settings . optgroups ) {
@@ -353,7 +353,7 @@ $.extend(Selectize.prototype, {
353353 * Triggered when the main control element
354354 * has a click event.
355355 *
356- * @param {object } e
356+ * @param {PointerEvent } e
357357 * @return {boolean }
358358 */
359359 onClick : function ( e ) {
@@ -613,7 +613,7 @@ $.extend(Selectize.prototype, {
613613 /**
614614 * Triggered on <input> focus.
615615 *
616- * @param {object } e (optional)
616+ * @param {FocusEvent } e (optional)
617617 * @returns {boolean }
618618 */
619619 onFocus : function ( e ) {
@@ -1602,8 +1602,6 @@ $.extend(Selectize.prototype, {
16021602 var i , active , value_next , wasFull ;
16031603 value = hash_key ( value ) ;
16041604
1605- if ( value === '' ) return ;
1606-
16071605 if ( self . items . indexOf ( value ) !== - 1 ) {
16081606 if ( inputMode === 'single' ) self . close ( ) ;
16091607 return ;
@@ -1613,10 +1611,10 @@ $.extend(Selectize.prototype, {
16131611 if ( inputMode === 'single' ) self . clear ( silent ) ;
16141612 if ( inputMode === 'multi' && self . isFull ( ) ) return ;
16151613
1616- $item = $ ( self . render ( 'item' , self . options [ value ] ) ) ;
1614+ $item = $ ( self . render ( 'item' , self . options [ value ] ) ) ;
16171615 wasFull = self . isFull ( ) ;
16181616 self . items . splice ( self . caretPos , 0 , value ) ;
1619- self . insertAtCaret ( $item ) ;
1617+ self . insertAtCaret ( $item ) ;
16201618 if ( ! self . isPending || ( ! wasFull && self . isFull ( ) ) ) {
16211619 self . refreshState ( ) ;
16221620 }
@@ -2017,7 +2015,10 @@ $.extend(Selectize.prototype, {
20172015 */
20182016 insertAtCaret : function ( $el ) {
20192017 var caret = Math . min ( this . caretPos , this . items . length ) ;
2020- var el = $el [ 0 ] ;
2018+ var el = $el [ 0 ] ;
2019+ /**
2020+ * @type {HTMLElement }
2021+ **/
20212022 var target = this . buffer || this . $control [ 0 ] ;
20222023
20232024 if ( caret === 0 ) {
0 commit comments