feat(Dropdown): selectedIndex -> selectedId (#1004)

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

* feat: omit `selectedIndex` from the `select` event
This commit is contained in:
Koichi Kiyokawa 2022-01-18 23:37:32 +09:00 committed by GitHub
commit e11a893bee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 52 deletions

View file

@ -25,10 +25,9 @@ export interface DropdownProps
itemToString?: (item: DropdownItem) => string;
/**
* Specify the selected item index
* @default -1
* Specify the selected item id
*/
selectedIndex?: number;
selectedId?: DropdownItemId;
/**
* Specify the type of dropdown
@ -146,7 +145,6 @@ export default class Dropdown extends SvelteComponentTyped<
{
select: CustomEvent<{
selectedId: DropdownItemId;
selectedIndex: number;
selectedItem: DropdownItem;
}>;
},