bootstrap-fullscreen-select icon indicating copy to clipboard operation
bootstrap-fullscreen-select copied to clipboard

Dependent selects onClose fire multiple times

Open dfloresgonz opened this issue 8 years ago • 1 comments

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.

  1. 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');

  2. 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);

dfloresgonz avatar Aug 10 '16 23:08 dfloresgonz

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!

Double-L avatar Sep 29 '16 05:09 Double-L