@bitrise/bitkit 13.342.0 → 13.343.0

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.342.0",
4
+ "version": "13.343.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -126,17 +126,17 @@ const useFilterForm = (props: Omit<FilterFormProps, 'onCancel'>) => {
126
126
  const items = useMemo(() => {
127
127
  let baseItems: string[] = [];
128
128
 
129
- if (isAsync) {
129
+ if (isAsync && searchValue) {
130
130
  baseItems = debouncedSearchValue ? foundOptions : options || [];
131
131
  } else {
132
132
  baseItems = searchValue ? filteredOptions : options || [];
133
133
  }
134
134
 
135
- if (!searchValue || (isAsync && !debouncedSearchValue)) {
136
- return baseItems;
135
+ if (preserveOptionOrder) {
136
+ return Array.from(new Set(baseItems));
137
137
  }
138
138
 
139
- return Array.from(new Set(preserveOptionOrder ? baseItems : [...value, ...baseItems]));
139
+ return Array.from(new Set([...value, ...baseItems]));
140
140
  }, [isAsync, debouncedSearchValue, searchValue, foundOptions, filteredOptions, options, preserveOptionOrder, value]);
141
141
 
142
142
  return {