Skip to content

Commit

Permalink
fix(Autocomplete): allow null for isItemSelected
Browse files Browse the repository at this point in the history
So users can use the default isItemSelected check without type warnings.
  • Loading branch information
ktmud committed Oct 27, 2020
1 parent 27e2fde commit 6e8b6e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/components/Autocomplete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export type AutocompleteProps<T extends Item = Item> = Omit<BaseInputProps, 'id'
getItemValue?: (item: T) => string;
/** Determine if an item is selectable. Non-selectable items will be disabled in the list. */
isItemSelectable?: (item: T, selected?: boolean) => boolean;
/** Determine if an item is selected. Will compare values by default if not defined. */
isItemSelected?: (item: T, value: string) => boolean;
/** Determine if an item is selected. Always returns false by default. Set as `null` will compare values. */
isItemSelected?: null | ((item: T, value: string) => boolean);
/** Load and show items with the current value when focused. */
loadItemsOnFocus?: boolean;
/** Load and show items on mount. */
Expand Down

0 comments on commit 6e8b6e2

Please sign in to comment.