@danielgindi/selectbox 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/DropList.js CHANGED
@@ -1158,7 +1158,15 @@ class DropList {
1158
1158
  if (typeof fn === 'function') {
1159
1159
  // Send the original items to the filter function
1160
1160
  filteredItems = p.filterFn(
1161
- p.items.map(x => x[ItemSymbol] ?? x),
1161
+ p.items.map(x => {
1162
+ const y = x[ItemSymbol];
1163
+ if (y !== undefined) {
1164
+ y[ItemSymbol] = x;
1165
+ return y;
1166
+ }
1167
+
1168
+ return x;
1169
+ }),
1162
1170
  term);
1163
1171
 
1164
1172
  if (Array.isArray(filteredItems)) {
package/lib/SelectBox.js CHANGED
@@ -1190,6 +1190,8 @@ class SelectBox {
1190
1190
  });
1191
1191
  };
1192
1192
  }
1193
+
1194
+ p.actualFilterFn = fn;
1193
1195
  p.dropList?.setFilterFn(fn);
1194
1196
  return this;
1195
1197
  }
@@ -1793,8 +1795,8 @@ class SelectBox {
1793
1795
  filterThrottleWindow: p.filterThrottleWindow,
1794
1796
  filterOnEmptyTerm: p.filterOnEmptyTerm,
1795
1797
  filterGroups: p.treatGroupSelectionAsItems,
1796
- filterEmptyGroups: p.treatGroupSelectionAsItems,
1797
- filterFn: p.filterFn,
1798
+ filterEmptyGroups: !p.treatGroupSelectionAsItems,
1799
+ filterFn: p.actualFilterFn,
1798
1800
 
1799
1801
  positionOptionsProvider: () => this._getDropListPositionOptions(),
1800
1802
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/selectbox",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "A collection of dom utilities. So you can work natively with the dom without dom frameworks.",
5
5
  "main": "dist/lib.cjs.min.js",
6
6
  "module": "lib/index.js",