mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
Type id
as any in ComboBox
, Dropdown
, MultiSelect
(#1019)
Loosen the prop type for `id`, `selectedId` to be `any` instead of a `string`.
This commit is contained in:
parent
144eba1747
commit
1f7b5560a8
11 changed files with 68 additions and 49 deletions
|
@ -3,7 +3,7 @@
|
|||
import type { ComboBoxItem } from "../types/ComboBox/ComboBox.svelte";
|
||||
|
||||
const items: ComboBoxItem[] = [
|
||||
{ id: "0", text: "Slack" },
|
||||
{ id: 0, text: "Slack" },
|
||||
{ id: "1", text: "Email" },
|
||||
{ id: "2", text: "Fax" },
|
||||
];
|
||||
|
@ -20,6 +20,9 @@
|
|||
titleText="Contact"
|
||||
placeholder="Select contact method"
|
||||
items="{items}"
|
||||
on:select="{(e) => {
|
||||
console.log(e.detail.selectedId);
|
||||
}}"
|
||||
/>
|
||||
|
||||
<ComboBox
|
||||
|
|
|
@ -7,10 +7,13 @@
|
|||
titleText="Contact"
|
||||
selectedId="0"
|
||||
items="{[
|
||||
{ id: '0', text: 'Slack' },
|
||||
{ id: 0, text: 'Slack' },
|
||||
{ id: '1', text: 'Email' },
|
||||
{ id: '2', text: 'Fax' },
|
||||
]}"
|
||||
on:select="{(e) => {
|
||||
console.log(e.detail.selectedId);
|
||||
}}"
|
||||
/>
|
||||
|
||||
<Dropdown
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
label="Select contact methods..."
|
||||
hideLabel
|
||||
items="{[
|
||||
{ id: '0', text: 'Slack' },
|
||||
{ id: 0, text: 'Slack' },
|
||||
{ id: '1', text: 'Email' },
|
||||
{ id: '2', text: 'Fax' },
|
||||
]}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue