File tree 2 files changed +8
-2
lines changed 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change
1
+ * Fixed bug making ` clearOptions ` function. Now it doesn't remove already selected options. (thanks @caseymct - #1079 )
1
2
* Fixed bug making ` allowEmptyOption: true ` useless (thanks @mcavalletto - #739 )
2
3
* Functions in option ` render ` can now return a DOM node in addition to
3
4
text. (#617 )
Original file line number Diff line number Diff line change @@ -1336,10 +1336,15 @@ $.extend(Selectize.prototype, {
1336
1336
self . loadedSearches = { } ;
1337
1337
self . userOptions = { } ;
1338
1338
self . renderCache = { } ;
1339
- self . options = self . sifter . items = { } ;
1339
+ var options = self . options ;
1340
+ $ . each ( self . options , function ( key , value ) {
1341
+ if ( self . items . indexOf ( key ) == - 1 ) {
1342
+ delete options [ key ] ;
1343
+ }
1344
+ } ) ;
1345
+ self . options = self . sifter . items = options ;
1340
1346
self . lastQuery = null ;
1341
1347
self . trigger ( 'option_clear' ) ;
1342
- self . clear ( ) ;
1343
1348
} ,
1344
1349
1345
1350
/**
You can’t perform that action at this time.
0 commit comments