Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript that can open and close an accordion #11

Closed
epochslee opened this issue Oct 15, 2019 · 1 comment
Closed

Javascript that can open and close an accordion #11

epochslee opened this issue Oct 15, 2019 · 1 comment

Comments

@epochslee
Copy link

I'm trying to figure out how I can open and close an accordion using javascript. What's the code for this or does it even exist?

@Lunrtick
Copy link
Owner

Currently there isn't a way to control the open items using JS (except for the initial state).

I think it would not be too difficult to add, as I imagine the accordion component would accept an array/object with booleans indicating the open/closed state, and would communicate changes back up to the parent, while also reading changes from the parent.

I don't have time to add this feature at the moment, though I do think it may be useful. You are most welcome to add it and submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants