apvarun / toastify-js

Pure JavaScript library for better notification messages
https://apvarun.github.io/toastify-js/
MIT License
2.09k stars 230 forks source link

Toastify does not work with new window #118

Open Awesome-E opened 1 year ago

Awesome-E commented 1 year ago

When creating a Toast in a popup window, the element is not properly added to the new document.

Steps:

  1. Create a new window with w = window.open('about:blank', '', 'width=200')
  2. Create a toast, and pass the new window's body w.document.body as the selector option.
  3. Show that toast notification

Expected: the toast shows up in the new window's body Actual: it shows up in the original

https://codepen.io/Awesome-E/pen/gOdVpQO?editors=1010