File tree 2 files changed +11
-2
lines changed 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
<!-- Feel free to put either your handle and/or full name, according to
2
2
your privacy needs -->
3
3
4
+ * Fixed bug making ` clearOptions ` function. Now it doesn't remove already selected options.
5
+
6
+ * (thanks @caseymct - #1079 )*
7
+
4
8
* New feature: allow to disable single options or complete optgroups
5
9
6
10
* @zeitiger *
Original file line number Diff line number Diff line change @@ -1366,10 +1366,15 @@ $.extend(Selectize.prototype, {
1366
1366
self . loadedSearches = { } ;
1367
1367
self . userOptions = { } ;
1368
1368
self . renderCache = { } ;
1369
- self . options = self . sifter . items = { } ;
1369
+ var options = self . options ;
1370
+ $ . each ( self . options , function ( key , value ) {
1371
+ if ( self . items . indexOf ( key ) == - 1 ) {
1372
+ delete options [ key ] ;
1373
+ }
1374
+ } ) ;
1375
+ self . options = self . sifter . items = options ;
1370
1376
self . lastQuery = null ;
1371
1377
self . trigger ( 'option_clear' ) ;
1372
- self . clear ( ) ;
1373
1378
} ,
1374
1379
1375
1380
/**
You can’t perform that action at this time.
0 commit comments