Skip to content

Commit 4043c14

Browse files
committed
wrap loaded event in requestAnimationFrame to avoid max call stack when a loaded.bs.select event listener calls selectpicker() (#899)
1 parent 77093f3 commit 4043c14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/bootstrap-select.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,10 @@
981981
this.fetchData(function () {
982982
that.render(true);
983983
that.buildList();
984-
that.$element.trigger('loaded' + EVENT_KEY);
984+
985+
requestAnimationFrame(function () {
986+
that.$element.trigger('loaded' + EVENT_KEY);
987+
});
985988
});
986989

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

0 commit comments

Comments
 (0)