bootstrap-fullscreen-select
bootstrap-fullscreen-select copied to clipboard
Dependent selects onClose fire multiple times
Hi I have came accross a bug, I have 4 selects one depends on the selected value of the previous one. I have my own functions called on the onClose function. 2 things.
-
The onClose function was getting called multiple times I notice it needed a unbind click in the _unbindEvents function. Add this line: this.$c.find('.mobileSelect-savebtn').unbind('click');
-
The onClose should be only called when the save-button is pressed for this I added a default parameter on the hide function.
`hide: function (save = null) {
/*
* hide animation with onClose callback
*/
this.$c.children('div').addClass('anim-' + this.animation);
var that = this;
this._updateBtnCount();
setTimeout(function () {
that.$c.hide();
$('body').removeClass('mobileSelect-noscroll');
/* MY CHANGE BEGIN*/
if(save) {
that.onClose.apply(that.$e);
}
/* MY CHANGE END */
}, this.animationSpeed);
},`
Then on line 232 change this that.hide(); to this that.hide(true);
I am sorry! Friends, now only to reply to your question! I am still in the learning stage, so I can‘t help you solve the problem. I am so sorry!