From 295839f9bbe4facc10b3efcb28d39be8b152a918 Mon Sep 17 00:00:00 2001 From: endigo9740 Date: Sun, 3 Dec 2023 12:47:02 -0600 Subject: [PATCH] Accordion Item ID fix --- .../src/lib/components/Accordion/AccordionItem.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/skeleton/src/lib/components/Accordion/AccordionItem.svelte b/packages/skeleton/src/lib/components/Accordion/AccordionItem.svelte index 3cbb2ba58..9a05e5e75 100644 --- a/packages/skeleton/src/lib/components/Accordion/AccordionItem.svelte +++ b/packages/skeleton/src/lib/components/Accordion/AccordionItem.svelte @@ -33,7 +33,7 @@ * Provide a unique input id. Auto-generated by default * @type {string} */ - export let id = String(Math.random()); + export let id = `accordion-control-${String(Math.random())}`; // Classes const cBase = ''; @@ -109,7 +109,7 @@ function onToggle(event?: SvelteEvent): void { const currentOpenState = autocollapse ? $active === id : open; /** @event {{ event: Event, id: string, open: boolean, autocollapse: boolean }} toggle - Fires when an accordion item is toggled. */ - dispatch('toggle', { event, id: `accordion-control-${id}`, open: currentOpenState, autocollapse }); + dispatch('toggle', { event, id, open: currentOpenState, autocollapse }); } // If auto-collapse mode enabled and item is set open, set as this item active