diff --git a/js/webform.confirmation.modal.js b/js/webform.confirmation.modal.js
index 56c1101..94b1650 100644
--- a/js/webform.confirmation.modal.js
+++ b/js/webform.confirmation.modal.js
@@ -30,6 +30,8 @@
           resizable: false,
           title: $element.find('.webform-confirmation-modal--title').text(),
           close: function (event) {
+            Drupal.dialog(event.target).close();
+            Drupal.detachBehaviors(event.target, null, 'unload');
             $(event.target).remove();
           }
         };
