Skip to content

Commit

Permalink
Merge branch 'master' into feature/distribute-splits
Browse files Browse the repository at this point in the history
  • Loading branch information
NikxDa authored Jan 10, 2024
2 parents 83df510 + 3eee0b1 commit 0efc08e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@ function findItem<T extends Item>(
strict: boolean,
suggestions: T[],
value: T | T['id'],
): T | null {
): T | T['id'] | null {
if (strict) {
const idx = suggestions.findIndex(item => item.id === value);
return idx === -1 ? null : suggestions[idx];
}

if (typeof value === 'string') {
throw new Error('value can be string only if strict = false');
}

return value;
}

Expand Down Expand Up @@ -302,7 +298,7 @@ function SingleAutocomplete<T extends Item>({
}
}}
highlightedIndex={highlightedIndex}
selectedItem={selectedItem || null}
selectedItem={selectedItem instanceof Object ? selectedItem : null}
itemToString={itemToString}
inputValue={value}
isOpen={isOpen}
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/2207.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MatissJanis]
---

Fix multi-autocomplete in rules page causing crashes

0 comments on commit 0efc08e

Please sign in to comment.