I'm adding new accordion sections to my UIKit data-uk-accordion dynamically, using ng-repeat.
<div class="uk-accordion" data-uk-accordion="{ collapse: false }">
<h3 class="uk-accordion-title uk-active" ng-repeat-start="driver in drivers">Driver {{driver.id}}</h3>
<div class="uk-accordion-content" ng-repeat-end>
...
</div>
When I add new accordion sections and I click on the title to collapse, I'm getting the following error:
TypeError: wrapper is undefined, on line 73 of accordion.js in UIkit 2.24.2:
wrapper.data('toggle').toggleClass(this.options.clsactive);
I tried adding data-uk-observe
to the accordion div, or its parent divs but didn't have any effect, and also tried to reinit the accordion manually by adding it an id, and running UIkit.accordion('#drivers') from console but no change.
Even tried to run UIkit.init()
from console but I'm getting the same error.
Any ideas how to reinit the accordion?