Skip to content

Fix nested accordion open#1863

Merged
mvorisek merged 9 commits intodevelopfrom
fix_nested_accordion_1693
Sep 24, 2022
Merged

Fix nested accordion open#1863
mvorisek merged 9 commits intodevelopfrom
fix_nested_accordion_1693

Conversation

@mvorisek
Copy link
Copy Markdown
Member

@mvorisek mvorisek commented Sep 20, 2022

fix #1693
fix (partly - Accordion only) #1728


// if a form control is part of an accordion section, it will open that section.
$section = $form->getClosestOwner($form->getControl($fieldName), AccordionSection::class);
$section = $form->getControl($fieldName)->getClosestOwner(AccordionSection::class);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mkrecek234 the getClosestOwner method was broken, does this fix #1728 too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mkrecek234 should be fixed when not nested

}

// Only set Accordion in Top container. Otherwise Nested accordion won't work.
if (!$this->getClosestOwner($this, AccordionSection::class) && !$this->isDynamicSection()) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ibelar why isDynamicSection was introduced, it is still needed?

@mvorisek mvorisek marked this pull request as ready for review September 20, 2022 16:22
@mvorisek mvorisek changed the title Fix nested accordion Fix nested accordion open Sep 20, 2022
@mvorisek mvorisek merged commit dea8209 into develop Sep 24, 2022
@mvorisek mvorisek deleted the fix_nested_accordion_1693 branch September 24, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Nested accordions static level 2. not works in demo

1 participant