-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix nested accordion open #1863
Conversation
@@ -30,7 +30,7 @@ protected function init(): void | |||
$jsError = [$form->js()->form('add prompt', $fieldName, $str)]; | |||
|
|||
// 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
protected function renderView(): void | ||
{ | ||
if ($this->type) { | ||
$this->addClass($this->type); | ||
} | ||
|
||
// Only set Accordion in Top container. Otherwise Nested accordion won't work. | ||
if (!$this->getClosestOwner($this, AccordionSection::class) && !$this->isDynamicSection()) { |
There was a problem hiding this comment.
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?
fix #1693
fix (partly - Accordion only) #1728