Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(type): item in isItemDisabled may be undefined (fixes #1623) #1631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hooks/useSelect/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export interface GetItemIndexByCharacterKeyOptions<Item> {
highlightedIndex: number
items: Item[]
itemToString(item: Item | null): string
isItemDisabled(item: Item, index: number): boolean
isItemDisabled(item: Item | undefined, index: number): boolean
}
4 changes: 2 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export enum UseSelectStateChangeTypes {

export interface UseSelectProps<Item> {
items: Item[]
isItemDisabled?(item: Item, index: number): boolean
isItemDisabled?(item: Item | undefined, index: number): boolean
itemToString?: (item: Item | null) => string
itemToKey?: (item: Item | null) => any
getA11yStatusMessage?: (options: UseSelectState<Item>) => string
Expand Down Expand Up @@ -552,7 +552,7 @@ export enum UseComboboxStateChangeTypes {

export interface UseComboboxProps<Item> {
items: Item[]
isItemDisabled?(item: Item, index: number): boolean
isItemDisabled?(item: Item | undefined, index: number): boolean
itemToString?: (item: Item | null) => string
itemToKey?: (item: Item | null) => any
getA11yStatusMessage?: (options: UseComboboxState<Item>) => string
Expand Down