doing toastr.remove(toast) should remove that particular toast, similar to the behavior of toastr.clear(toast). However, due to this line if ($toastElement.is(':visible')) { return; } in removeToast, visible toasts aren't removed.
toastr.options.timeOut = 0;
var toast = toastr.info("This is a toast");
setTimeout(function() {
console.log("I should be removing the toast right now");
toastr.remove(toast);
}, 2000);
doing
toastr.remove(toast)
should remove that particular toast, similar to the behavior oftoastr.clear(toast)
. However, due to this lineif ($toastElement.is(':visible')) { return; }
inremoveToast
, visible toasts aren't removed.running the below code in the console of http://codeseven.github.io/toastr/demo.html shows this.