Merge pull request #47 from metonym/accordion

fix(accordion): set animation on click
This commit is contained in:
Eric Liu 2019-12-20 16:37:20 -08:00 committed by GitHub
commit 70c6336a68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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