mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
fix(combo-box): do not reset selectedIndex to 0, fallback to empty string
This commit is contained in:
parent
5d900dfd91
commit
0ca50d988e
1 changed files with 1 additions and 5 deletions
|
@ -129,10 +129,6 @@
|
|||
filteredItems = items.filter((item) => shouldFilterItem(item, value));
|
||||
} else {
|
||||
highlightedIndex = -1;
|
||||
|
||||
if (!selectedItem) {
|
||||
selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -148,7 +144,7 @@
|
|||
: undefined;
|
||||
$: filteredItems = items.filter((item) => shouldFilterItem(item, value));
|
||||
$: selectedItem = items[selectedIndex];
|
||||
$: inputValue = selectedItem ? selectedItem.text : undefined;
|
||||
$: inputValue = selectedItem ? selectedItem.text : "";
|
||||
$: value = inputValue;
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue