Closed gavinhungry closed 5 years ago
Nice catch. The library is written in ES5 currently and there is an open task to move to ES6+ ( #15 ). However, this can be solved by changing the following:
this.options.stopOnFocus = options.stopOnFocus || true;
⬇️
this.options.stopOnFocus = options.stopOnFocus === undefined? true: options.stopOnFocus;
Fixed in v1.6.1
The default option for
stopOnFocus
(#21, #22) cannot be changed to a falsey value: https://github.com/apvarun/toastify-js/blob/35c57bb3dc391ffdcf4e9ce89635c57dcaee56d4/src/toastify.js#L52false || true
is stilltrue
, so settingstopOnFocus: false
will do nothing. The best way to fix this would be to instead use ES6 default parameters, something like: