mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(select-item): keep store subscription
This commit is contained in:
parent
7537b1db98
commit
3cbb903e42
1 changed files with 1 additions and 3 deletions
|
@ -14,13 +14,11 @@
|
||||||
|
|
||||||
let selected = false;
|
let selected = false;
|
||||||
|
|
||||||
const unsubscribe = ctx.selectedValue.subscribe(currentValue => {
|
ctx.selectedValue.subscribe(currentValue => {
|
||||||
if (currentValue === value) {
|
if (currentValue === value) {
|
||||||
selected = true;
|
selected = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
unsubscribe();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<option class={cx('--select-option', className)} {value} {disabled} {hidden} {style} {selected}>
|
<option class={cx('--select-option', className)} {value} {disabled} {hidden} {style} {selected}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue