mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
fix(combobox): filtered ComboBox handling with keyboard
This commit is contained in:
parent
3cadf2c001
commit
c8fe0b992b
1 changed files with 3 additions and 4 deletions
|
@ -113,10 +113,10 @@
|
|||
|
||||
function change(dir) {
|
||||
let index = highlightedIndex + dir;
|
||||
|
||||
let _items = !filteredItems?.length ? items : filteredItems;
|
||||
if (index < 0) {
|
||||
index = items.length - 1;
|
||||
} else if (index >= items.length) {
|
||||
index = _items.length - 1;
|
||||
} else if (index >= _items.length) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,6 @@
|
|||
: undefined;
|
||||
$: filteredItems = items.filter((item) => shouldFilterItem(item, value));
|
||||
$: selectedItem = items[selectedIndex];
|
||||
$: inputValue = selectedItem ? selectedItem.text : "";
|
||||
$: value = inputValue;
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue