mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +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 ChevronRight16 from 'carbon-icons-svelte/lib/ChevronRight16';
|
||||||
import { cx } from '../../lib';
|
import { cx } from '../../lib';
|
||||||
|
|
||||||
$: animation = open ? 'expanding' : 'collapsing';
|
let animation = undefined;
|
||||||
|
|
||||||
$: _class = cx(
|
$: _class = cx(
|
||||||
'--accordion__item',
|
'--accordion__item',
|
||||||
open && '--accordion__item--active',
|
open && '--accordion__item--active',
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
on:click
|
on:click
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
open = !open;
|
open = !open;
|
||||||
|
animation = open ? 'expanding' : 'collapsing';
|
||||||
}}
|
}}
|
||||||
on:mouseover
|
on:mouseover
|
||||||
on:mouseenter
|
on:mouseenter
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue