Skip to content

Commit

Permalink
[fix](@svelteui/core): pass Accordion transitionDuration prop to Coll…
Browse files Browse the repository at this point in the history
…apse

This now allows controlling the collapse transition duration to match the chevron animation
  • Loading branch information
BeeMargarida committed Apr 26, 2024
1 parent 4102c39 commit 6cd35af
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/docs/src/routes/core/accordion/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ When `multiple` is `true`, this should be provided as an arrays of strings.

## Transition

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

<Demo demo={AccordionDemos.transitionDuration} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,15 @@
</Accordion.Item>
</Accordion>
</Story>

<Story
name="Transition Duration (1s)"
id="accordionTransitionDurationLongStory"
args={{ transitionDuration: 1000 }}
/>

<Story
name="Transition Duration (0s)"
id="accordionNoTransitionDurationStory"
args={{ transitionDuration: 0 }}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Item of an accordion.
id={$ctx.getControlsId(value)}
aria-labelledby={$ctx.getRegionId(value)}
open={$ctx.isItemActive(value)}
transitionDuration={$ctx.transitionDuration}
>
<div class={classes.panel}>
<slot />
Expand Down

0 comments on commit 6cd35af

Please sign in to comment.