feat(ComboBox): selectedIndex -> selectedId (#1016)

* feat(breaking): selectedIndex -> selectedId in ComboBox

* docs: update ComboBox
This commit is contained in:
Koichi Kiyokawa 2022-01-18 23:37:55 +09:00 committed by GitHub
commit cde8a79fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 91 additions and 102 deletions

View file

@ -21,10 +21,9 @@ export interface ComboBoxProps
itemToString?: (item: ComboBoxItem) => string;
/**
* Set the selected item by value index
* @default -1
* Set the selected item by value id
*/
selectedIndex?: number;
selectedId?: string;
/**
* Specify the selected combobox value
@ -141,11 +140,7 @@ export interface ComboBoxProps
export default class ComboBox extends SvelteComponentTyped<
ComboBoxProps,
{
select: CustomEvent<{
selectedId: string;
selectedIndex: number;
selectedItem: ComboBoxItem;
}>;
select: CustomEvent<{ selectedId: string; selectedItem: ComboBoxItem }>;
keydown: WindowEventMap["keydown"];
keyup: WindowEventMap["keyup"];
focus: WindowEventMap["focus"];