Skip to content

Commit

Permalink
πŸ› fix for #3493, make options readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
oddvernes committed Jun 13, 2024
1 parent fe3c7bd commit 40423a8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export type AutocompleteChanges<T> = { selectedItems: T[] }

export type AutocompleteProps<T> = {
/** List of options in dropdown */
options: T[]
options: readonly T[]
/** Label for the select element */
label: ReactNode
/** Array of initial selected items
Expand Down Expand Up @@ -543,7 +543,7 @@ function AutocompleteInner<T>(

// MARK: downshift state
let comboBoxProps: UseComboboxProps<T> = {
items: availableItems,
items: availableItems as T[], //can not pass readonly type to downshift so we cast it to regular T[]
initialSelectedItem: initialSelectedOptions[0],
isItemDisabled(item) {
return optionDisabled(item)
Expand Down

0 comments on commit 40423a8

Please sign in to comment.