Skip to content

Commit

Permalink
fix(toast): destroy toast after onremove callback
Browse files Browse the repository at this point in the history
The onRemove callback was called after the this reference was destroyed
  • Loading branch information
lubber-de committed Feb 26, 2023
1 parent 85bc292 commit 2806406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/modules/toast.js
Expand Up @@ -117,11 +117,11 @@
if ($toastBox) {
module.debug('Removing toast', $toastBox);
module.unbind.events();
settings.onRemove.call($toastBox, element);
$toastBox.remove();
$toastBox = undefined;
$toast = undefined;
$animationObject = undefined;
settings.onRemove.call($toastBox, element);
$progress = undefined;
$progressBar = undefined;
$close = undefined;
Expand Down

0 comments on commit 2806406

Please sign in to comment.