Skip to content

Commit 6cd35af

Browse files
committed
[fix](@svelteui/core): pass Accordion transitionDuration prop to Collapse
This now allows controlling the collapse transition duration to match the chevron animation
1 parent 4102c39 commit 6cd35af

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

apps/docs/src/routes/core/accordion/+page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ When `multiple` is `true`, this should be provided as an arrays of strings.
5959

6060
## Transition
6161

62-
It's possible to change the chevron transition duration by modifying the prop `transitionDuration` (in milliseconds).
62+
It's possible to change the chevron and collapse transition duration by modifying the prop `transitionDuration` (in milliseconds).
6363

6464
<Demo demo={AccordionDemos.transitionDuration} />
6565

packages/svelteui-core/src/components/Accordion/Accordion.stories.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,15 @@
9494
</Accordion.Item>
9595
</Accordion>
9696
</Story>
97+
98+
<Story
99+
name="Transition Duration (1s)"
100+
id="accordionTransitionDurationLongStory"
101+
args={{ transitionDuration: 1000 }}
102+
/>
103+
104+
<Story
105+
name="Transition Duration (0s)"
106+
id="accordionNoTransitionDurationStory"
107+
args={{ transitionDuration: 0 }}
108+
/>

packages/svelteui-core/src/components/Accordion/AccordionItem/AccordionItem.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Item of an accordion.
9090
id={$ctx.getControlsId(value)}
9191
aria-labelledby={$ctx.getRegionId(value)}
9292
open={$ctx.isItemActive(value)}
93+
transitionDuration={$ctx.transitionDuration}
9394
>
9495
<div class={classes.panel}>
9596
<slot />

0 commit comments

Comments
 (0)