Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Programmatically opening/closing panels #10

Open
shimizust-zz opened this issue Sep 13, 2018 · 2 comments
Open

Programmatically opening/closing panels #10

shimizust-zz opened this issue Sep 13, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@shimizust-zz
Copy link

Is it possible to programmatically open and close panels? One rationale for this functionality is if the accordion contains form elements and there is a validation error inside a closed panel, we open it up.

@vasilionjea
Copy link
Owner

vasilionjea commented Sep 13, 2018

Unfortunately there isn't an easy way to do it at the moment without some refactoring. I can definitely see the need for it though. I'll look into it at some point (unless you want to take a stab at it). In the mean time you could programmatically trigger a click DOM event on the relevant element: https://ember-twiddle.com/b1f94c70709e222102f45b423b2cc4d8?openFiles=controllers.application.js%2C Not the cleanest approach but it works.

Here is a Gist in case Ember Twiddle dies one day: https://gist.github.com/vasilionjea/b1f94c70709e222102f45b423b2cc4d8

@vasilionjea vasilionjea added the enhancement New feature or request label Sep 13, 2018
@shimizust-zz
Copy link
Author

Thanks for the information and quick response. I'm just triggering a click, as you suggested, which works fine for now. I don't think I'll be able to look into it right now, though.

Thanks for building this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants