Page 1 of 1

Growl causes error when message fades out

Posted: 19 Oct 2017, 13:54
by kaho29
I just noticed, that since version 1.1.0 the Growl Component throws a Javascript error when the message is faded out automatically.

I get the following error:

Code: Select all

Uncaught TypeError: Cannot read property 'forEach' of undefined at Growl.js:87
It's this code block that fails:

Code: Select all

{
        key: 'removeAll',
        value: function removeAll() {
            var _this3 = this;

            if (this.state.messages && this.state.messages.length) {
                _DomHandler2.default.fadeOut(this.container, 250);

                setTimeout(function () {
                    _this3.value.forEach(function (msg, index) { // this line fails because _this3.value is undefined when the timeout triggers
                        _this3.invokeOnClose(null, msg);
                    });

                    _this3.setState({
                        messages: null
                    });
                }, 250);
            }
        }
    }

Re: Growl causes error when message fades out

Posted: 20 Oct 2017, 16:41
by cagatay.civici