Skip to content

Commit

Permalink
wrap loaded event in requestAnimationFrame to avoid max call stack wh…
Browse files Browse the repository at this point in the history
…en a loaded.bs.select event listener calls selectpicker() (#899)
  • Loading branch information
caseyjhol committed May 8, 2020
1 parent 77093f3 commit 4043c14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,10 @@
this.fetchData(function () {
that.render(true);
that.buildList();
that.$element.trigger('loaded' + EVENT_KEY);

requestAnimationFrame(function () {
that.$element.trigger('loaded' + EVENT_KEY);
});
});

if (this.options.dropdownAlignRight === true) this.$menu[0].classList.add(classNames.MENURIGHT);
Expand Down

0 comments on commit 4043c14

Please sign in to comment.