mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore(combo-box): remove unnecessary selectedId assignments
selectedId is set based on the selectedIndex
This commit is contained in:
parent
8dbcf17e89
commit
382b2f6e85
1 changed files with 0 additions and 2 deletions
|
@ -233,7 +233,6 @@
|
||||||
open = !open;
|
open = !open;
|
||||||
if (highlightedIndex > -1 && highlightedIndex !== selectedIndex) {
|
if (highlightedIndex > -1 && highlightedIndex !== selectedIndex) {
|
||||||
selectedIndex = highlightedIndex;
|
selectedIndex = highlightedIndex;
|
||||||
selectedId = items[selectedIndex].id;
|
|
||||||
open = false;
|
open = false;
|
||||||
}
|
}
|
||||||
} else if (key === 'Tab') {
|
} else if (key === 'Tab') {
|
||||||
|
@ -287,7 +286,6 @@
|
||||||
active={selectedIndex === i || selectedId === item.id}
|
active={selectedIndex === i || selectedId === item.id}
|
||||||
highlighted={highlightedIndex === i || selectedIndex === i}
|
highlighted={highlightedIndex === i || selectedIndex === i}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
selectedId = item.id;
|
|
||||||
selectedIndex = items
|
selectedIndex = items
|
||||||
.map(({ id }) => id)
|
.map(({ id }) => id)
|
||||||
.indexOf(filteredItems[i].id);
|
.indexOf(filteredItems[i].id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue