CodeSeven / toastr

Simple javascript toast notifications
http://www.toastrjs.com
MIT License
11.96k stars 2.04k forks source link

closeButton Option Not Honored #623

Open jonathancadepowers opened 5 years ago

jonathancadepowers commented 5 years ago

All other options work perfectly.

I'm calling toastr via Rails app, within an AJAX sequence. My JavaScript template:

$( "#comment-<%= @comment.id %>" ).fadeOut(650);
toastr.options = {
  "closeButton": true,
  "debug": false,
  "newestOnTop": true,
  "progressBar": false,
  "positionClass": "toast-bottom-right",
  "preventDuplicates": true,
  "onclick": null,
  "showDuration": "300",
  "hideDuration": "1000",
  "timeOut": "2500",
  "extendedTimeOut": "1000",
  "showEasing": "swing",
  "hideEasing": "linear",
  "showMethod": "fadeIn",
  "hideMethod": "fadeOut"
}
toastr["success"]("It's gone for good.", "Comment Deleted!")

The toast appears just fine, but the close button never appears.

When I inspect the DOM, the <button> tag is indeed not present (unlike when I inspect the DOM on the toastr demo site).

Any ideas?

delboy1978uk commented 3 years ago

Did you find out what was causing this, I have the same issue