fix(ComboBox): handling TAB behaviour

This commit is contained in:
István Pató 2022-09-07 13:00:45 +02:00
commit a965f3193c
2 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,7 @@
<script>
import { ComboBox } from "carbon-components-svelte";
let selectedId
function shouldFilterItem(item, value) {
if (!value) return true;
return item.text.toLowerCase().includes(value.toLowerCase());
@ -8,6 +9,7 @@
</script>
<ComboBox
bind:selectedId
titleText="Contact"
placeholder="Select contact method"
items="{[
@ -16,4 +18,5 @@
{ id: '2', text: 'Fax' },
]}"
shouldFilterItem="{shouldFilterItem}"
/>
helperText="selectedId: {selectedId}"
/>