Skip to content

New Feature: Accordion - expanded state control #82

@ncoetzer

Description

@ncoetzer

Is your feature request related to a problem? Please describe.
We've recently had a request from a client (Campbell's) to extend the accordion component with functionality to control its initial expanded state upon page load. By default, this feature is not built-in and would probably have to be added manually (which I'm almost sure has been done several times in the past). This seemed to be a handy feature that could benefit other projects/clients as well.

Describe the solution you'd like
As a solution, we've implemented ToggleControls on two levels:

  • A global toggle that controls the expanded state for all accordion items. When the global switch is enabled, all inner child items will inherit the setting
    77ce627f07045f77613575d23c6d54f0

  • Item-specific toggle that only controls its own expanded state. This option is only available if the global option has been disabled
    77e3e91999ab20ab3dfd4d1bd78d4ddb

As a result, not only would administrators have more control to customize the initial state of the accordion, but it would also improve the user experience in the editor at the same time.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions