Commit 70f71292 authored by yann300's avatar yann300

Fix modal dialog callback being called multiple times

When the modal closes, we need to remove the DOM element. If not, we create a new EventListener associated with the modal each time the modal shows up. And basically when the user `Cancel` the modal, all the previous callback where the modal was used get called. That's pretty critical
parent 6d32d939
...@@ -82,6 +82,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => { ...@@ -82,6 +82,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
function hide () { function hide () {
if (container) container.style.display = 'none' if (container) container.style.display = 'none'
if (container.parentElement) container.parentElement.removeChild(container)
} }
function show () { function show () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment