mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +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 });
|
setContext('Select', { selected });
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
defaultValue = $selected;
|
selected.set(defaultValue);
|
||||||
dispatch('change', $selected);
|
dispatch('change', $selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: defaultValue = $selected;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class={cx('--form-item')} {style}>
|
<div class={cx('--form-item')} {style}>
|
||||||
|
@ -82,7 +84,6 @@
|
||||||
<div class={_helperTextClass}>{helperText}</div>
|
<div class={_helperTextClass}>{helperText}</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if !inline}
|
{#if !inline}
|
||||||
<div class={cx('--select-input__wrapper')} data-invalid={invalid || undefined}>
|
<div class={cx('--select-input__wrapper')} data-invalid={invalid || undefined}>
|
||||||
<select
|
<select
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue