Skip to content

Commit

Permalink
Fix Combobox virtual mode types for multiple (#3392)
Browse files Browse the repository at this point in the history
When multiple is specified we expect TValue to already be an array, so lets just
ensure its an array and use it as the type for virtual.options. Similarly the
disabled callback gets passed a TValue, but when multiple is true it is passed
something of type element of TValue.

Behaviour in javascript lines up with this fine, just a type level fix afaik.
  • Loading branch information
kradical authored Jul 18, 2024
1 parent f335372 commit ca6a455
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,10 @@ export type ComboboxProps<
name?: string
immediate?: boolean
virtual?: {
options: NoInfer<TValue>[]
disabled?: (value: NoInfer<TValue>) => boolean
options: TMultiple extends true ? EnsureArray<NoInfer<TValue>> : NoInfer<TValue>[]
disabled?: (
value: TMultiple extends true ? EnsureArray<NoInfer<TValue>>[number] : NoInfer<TValue>
) => boolean
} | null

onClose?(): void
Expand Down

0 comments on commit ca6a455

Please sign in to comment.