@integry/sdk 4.6.96 → 4.6.97
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/package.json
CHANGED
|
@@ -240,21 +240,9 @@ const ListBox = (props: ListBoxProps) => {
|
|
|
240
240
|
|
|
241
241
|
useEffect(() => {
|
|
242
242
|
if (query && isSearchable) {
|
|
243
|
-
const filtered =
|
|
244
|
-
.
|
|
245
|
-
|
|
246
|
-
scoreFn: (keysResult) => {
|
|
247
|
-
const nameResult = keysResult[0];
|
|
248
|
-
const tagsResult = keysResult[1];
|
|
249
|
-
// assign higher score to name result
|
|
250
|
-
const score = Math.max(
|
|
251
|
-
nameResult ? nameResult.score + 100 : -Infinity,
|
|
252
|
-
tagsResult ? tagsResult.score : -Infinity,
|
|
253
|
-
);
|
|
254
|
-
return score;
|
|
255
|
-
},
|
|
256
|
-
})
|
|
257
|
-
.map((el) => el.obj);
|
|
243
|
+
const filtered = items.filter((item) =>
|
|
244
|
+
item.value.toLowerCase().includes(query.toLowerCase()),
|
|
245
|
+
);
|
|
258
246
|
setHighlightedIndex(-1);
|
|
259
247
|
setSortedFilteredItems(filtered);
|
|
260
248
|
if (filtered.length === 1) setHighlightedIndex(0);
|