Created by: Nikita240
Fixes #15741 (closed).
The setup
Suppose you have collapsible panels. You want to have dual controls for them. That means, 2 separate buttons for collapsing each panel. Now, this would normally work with bootstrap, but you want one set of controls to have accordion like behavior, and the other set of controls to have normal behavior.
The problem
The collapsible panels assume the control state of the first button you click. So if you click an accordion button first, the non-accordion button will behave like the accordion button, and vice-versa.
Demo (clone the branch and open test.html)
The cause
Bootstrap creates a new Collapse
object for each collapsible panel. The problem is, it creates it once during the first collapse event. This means all the options of the Collapse
object stay the same. Because of this, when you trigger another collapse with a different controller, it still "thinks" you triggered it from the old one, because the Collapse
objects parameters still point to the old controller.
The solution
Set the $trigger
property and recalculate parent during each controller click.
Demo (clone the branch and open test.html)