Skip to content

Conversation

@zinigor
Copy link
Contributor

@zinigor zinigor commented Dec 22, 2025

This PR makes it possible for the Accordion to pass through the 'isOpen' property down to the collapsible section. This way the fields can use the following setup to remain open by default:

    $fields->render_field('accordion-open-by-default', [
        'label'   => 'Accordion',
        'type'    => 'accordion',
        'title'   => 'Simple Open Accordion',
        'isOpen'  => true,
        'value'   => $fields->fetch_value('accordion'),
        'fields'  => [
            [
                'label' => 'Text',
                'type'  => 'text',
                'name'  => 'text_name',
            ],
        ]
    ]);

Copy link
Contributor

@nicolas-jaussaud nicolas-jaussaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and for updating the examples/tests as well!

I left a small comment regarding the field registration in the example, but other than that feel free to merge!

@zinigor zinigor merged commit 0c07986 into main Dec 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants