mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
fix(combobox): value should call itemToString
with filtered item (#1411)
Fixes #1405 When using the `shouldFilterItem` prop, the `ComboBox` does not display the custom label set with `itemToString` in the input after a selection.
This commit is contained in:
parent
e3f98cde4b
commit
8bd615b250
3 changed files with 44 additions and 4 deletions
|
@ -178,7 +178,7 @@
|
|||
highlightedId = undefined;
|
||||
} else {
|
||||
// programmatically set value
|
||||
value = selectedItem.text;
|
||||
value = itemToString(selectedItem);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -294,14 +294,14 @@
|
|||
) {
|
||||
open = false;
|
||||
if (filteredItems[highlightedIndex]) {
|
||||
value = filteredItems[highlightedIndex].text;
|
||||
value = itemToString(filteredItems[highlightedIndex]);
|
||||
selectedItem = filteredItems[highlightedIndex];
|
||||
selectedId = filteredItems[highlightedIndex].id;
|
||||
}
|
||||
} else {
|
||||
open = false;
|
||||
if (filteredItems[0]) {
|
||||
value = filteredItems[0].text;
|
||||
value = itemToString(filteredItems[0]);
|
||||
selectedItem = filteredItems[0];
|
||||
selectedId = filteredItems[0].id;
|
||||
}
|
||||
|
@ -382,7 +382,7 @@
|
|||
open = false;
|
||||
|
||||
if (filteredItems[i]) {
|
||||
value = filteredItems[i].text;
|
||||
value = itemToString(filteredItems[i]);
|
||||
}
|
||||
}}"
|
||||
on:mouseenter="{() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue