mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
feat(combo-box): render checkmark icon for selected item
This commit is contained in:
parent
89786a76b4
commit
86eff17886
1 changed files with 4 additions and 0 deletions
|
@ -95,6 +95,7 @@
|
||||||
export let listRef = null;
|
export let listRef = null;
|
||||||
|
|
||||||
import { createEventDispatcher, afterUpdate, tick } from "svelte";
|
import { createEventDispatcher, afterUpdate, tick } from "svelte";
|
||||||
|
import Checkmark16 from "carbon-icons-svelte/lib/Checkmark16/Checkmark16.svelte";
|
||||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16/WarningFilled16.svelte";
|
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16/WarningFilled16.svelte";
|
||||||
import WarningAltFilled16 from "carbon-icons-svelte/lib/WarningAltFilled16/WarningAltFilled16.svelte";
|
import WarningAltFilled16 from "carbon-icons-svelte/lib/WarningAltFilled16/WarningAltFilled16.svelte";
|
||||||
import ListBox from "../ListBox/ListBox.svelte";
|
import ListBox from "../ListBox/ListBox.svelte";
|
||||||
|
@ -331,6 +332,9 @@
|
||||||
}}"
|
}}"
|
||||||
>
|
>
|
||||||
{itemToString(item)}
|
{itemToString(item)}
|
||||||
|
{#if selectedItem && selectedItem.id === item.id}
|
||||||
|
<Checkmark16 class="bx--list-box__menu-item__selected-icon" />
|
||||||
|
{/if}
|
||||||
</ListBoxMenuItem>
|
</ListBoxMenuItem>
|
||||||
{/each}
|
{/each}
|
||||||
</ListBoxMenu>
|
</ListBoxMenu>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue