mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(select): update defaultValue when $selected changes
This commit is contained in:
parent
892d95931d
commit
35806566a0
1 changed files with 3 additions and 2 deletions
|
@ -42,9 +42,11 @@
|
|||
setContext('Select', { selected });
|
||||
|
||||
$: {
|
||||
defaultValue = $selected;
|
||||
selected.set(defaultValue);
|
||||
dispatch('change', $selected);
|
||||
}
|
||||
|
||||
$: defaultValue = $selected;
|
||||
</script>
|
||||
|
||||
<div class={cx('--form-item')} {style}>
|
||||
|
@ -82,7 +84,6 @@
|
|||
<div class={_helperTextClass}>{helperText}</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{#if !inline}
|
||||
<div class={cx('--select-input__wrapper')} data-invalid={invalid || undefined}>
|
||||
<select
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue