Skip to content

Commit 1cc48c2

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 fb5e114 commit 1cc48c2

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
@@ -988,7 +988,10 @@
988988
this.fetchData(function () {
989989
that.render(true);
990990
that.buildList();
991-
that.$element.trigger('loaded' + EVENT_KEY);
991+
992+
requestAnimationFrame(function () {
993+
that.$element.trigger('loaded' + EVENT_KEY);
994+
});
992995
});
993996

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

0 commit comments

Comments
 (0)