From 6636e07c36d2e33c45266569861244eb5fb83c5b Mon Sep 17 00:00:00 2001 From: BeeMargarida Date: Fri, 26 Apr 2024 10:52:51 +0100 Subject: [PATCH] [fix](@svelteui/core): fix value reactivity prop in Accordion --- .../src/components/Accordion/Accordion.stories.svelte | 9 ++++++++- .../src/components/Accordion/Accordion.svelte | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/svelteui-core/src/components/Accordion/Accordion.stories.svelte b/packages/svelteui-core/src/components/Accordion/Accordion.stories.svelte index 050829c6..832b33af 100644 --- a/packages/svelteui-core/src/components/Accordion/Accordion.stories.svelte +++ b/packages/svelteui-core/src/components/Accordion/Accordion.stories.svelte @@ -75,7 +75,14 @@ - (value = e.detail)}> + + {value} +
Typescript Based
Build type safe applications. All SvelteUI packages are built with TypeScript and support it by diff --git a/packages/svelteui-core/src/components/Accordion/Accordion.svelte b/packages/svelteui-core/src/components/Accordion/Accordion.svelte index c9b25748..9a760dc2 100644 --- a/packages/svelteui-core/src/components/Accordion/Accordion.svelte +++ b/packages/svelteui-core/src/components/Accordion/Accordion.svelte @@ -40,7 +40,7 @@ const dispatch = createEventDispatcher(); - let _value: AccordionValue = value || defaultValue; + let _value: AccordionValue; let stateContent = { variant, order, @@ -56,6 +56,7 @@ const state = writable(stateContent); // converts internal value into correct type + $: _value = value || defaultValue; $: { if (multiple && !Array.isArray(_value)) { _value = (_value ? [_value] : []) as AccordionValue;