[EuiAccordion] Allow external control#3614
Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3614/ |
|
Changes look good, though thinking about
Thoughts on calling |
I could definitely go either way on this. |
I think so; let's go that way, then this is good to merge |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3614/ |
|
Looks like the accordion_forceState.js example wasn't updated and expects the inverse value in |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3614/ |
jenkins test this |
chandlerprall
left a comment
There was a problem hiding this comment.
Changes LGTM! Tested in the PR's docs
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3614/ |
Summary
Resolves #3594 by allowing
forceStateandonToggleto work together as an external state value and update function pair.When
forceStateis in useonTogglewill be called with a boolean reflecting the current open/closed state. This might be slightly confusing as standardonToggleis called with a boolean reflecting the new open/closed state after click.Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in IE11 and Firefox- [ ] Checked for accessibility including keyboard-only and screenreader modes