mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(accordion): set animation on click
This commit is contained in:
parent
5ec9c0089f
commit
39ca81f9a8
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,8 @@
|
|||
import ChevronRight16 from 'carbon-icons-svelte/lib/ChevronRight16';
|
||||
import { cx } from '../../lib';
|
||||
|
||||
$: animation = open ? 'expanding' : 'collapsing';
|
||||
let animation = undefined;
|
||||
|
||||
$: _class = cx(
|
||||
'--accordion__item',
|
||||
open && '--accordion__item--active',
|
||||
|
@ -33,6 +34,7 @@
|
|||
on:click
|
||||
on:click={() => {
|
||||
open = !open;
|
||||
animation = open ? 'expanding' : 'collapsing';
|
||||
}}
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue