niutech / showModalDialog

window.showModalDialog polyfill using a <dialog> element
https://niutech.github.io/showModalDialog/demo.html
Apache License 2.0
177 stars 88 forks source link

Unable to close the second iteration of popup #55

Closed npriller closed 3 years ago

npriller commented 3 years ago

Hello I use the async and await polyfill. I have it attached to a button click. When I click the button the first time the code executes, opens a popup and I can successfully close it and return to the caller via parent.document.getElementsByTagName('dialog')[0].close(); All is well. Now if I click the button again and recreate the popup I'm unable to close it. It is on the screen but the execution of parent.document.getElementsByTagName('dialog')[0].close(); does nothing. Chrome DEV-Tools/Page window at this point show 2 dialog-body, as if there are 2 of them. Any idea what is going on here? It only works the first time. Thanks for any help!