-
-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Description
I can't get the slotted Dropdown to work with Typescript:
<script lang="ts">
import { Dropdown } from "carbon-components-svelte";
let items = [
{ id: "0", text: "Slack" },
{ id: "1", text: "Email" },
{ id: "2", text: "Fax" },
];
</script>
<div>
<Dropdown titleText="Contact" selectedId="0" {items} let:item let:index>
<div>
<strong>{item.text}</strong>
</div>
<div>
id: {item.id} - index:
{index}
</div>
</Dropdown>
</div>
<style lang="scss">
:global(.bx--list-box__menu-item, .bx--list-box__menu-item__option) {
height: auto;
}
</style>
In the console I get this warning on every refresh: <Dropdown> received an unexpected slot "default".
The rendered output shows the Dropdown with the standard UI. Do I need to do something special to make it work with ts?
Metadata
Metadata
Assignees
Labels
No labels