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

Accordion: isOpen should be two-way bindable #2617

Closed
steelsojka opened this issue Sep 11, 2017 · 2 comments
Closed

Accordion: isOpen should be two-way bindable #2617

steelsojka opened this issue Sep 11, 2017 · 2 comments

Comments

@steelsojka
Copy link
Contributor

The accordion-group component should be able to be bound 2 ways, since the isOpen state can be modified from inside the component and from outside it. The problem scenario occurs when isOpen is bound from outside the component and the user clicks on the accordion. Internally the state is changes, but the binding has not. The change is not communicated back to the parent component.

Instead of the internal state being modified it should emit through an output named isOpenChange with the new value. This will sync the states.

This will be a breaking change however since, currently, if the user clicks on a group when isOpen is bound they still toggle the open state. This change would only respect the bound value. It would require a 2 way data bind to produce the expected behavior.

@steelsojka
Copy link
Contributor Author

The other alternative is to at least provide an output with the new state to be able to update the parent component. This would be the easiest and non breaking change.

@CodisRedding
Copy link

Is two-way binding of isOpen for the accordion implemented in 3.3.0? I'm using isOpen in the component and it will not collapse a group except for the first time.

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

3 participants