diff --git a/core/misc/dialog.ajax.js b/core/misc/dialog.ajax.js
index c33a5e699716abf1a16e445d1468c71a666188b0..d2d8d3a88cedb22dbebb1149a80a123b97cb81ce 100644
--- a/core/misc/dialog.ajax.js
+++ b/core/misc/dialog.ajax.js
@@ -105,7 +105,7 @@
 
     // Open the dialog itself.
     response.dialogOptions = response.dialogOptions || {};
-    var dialog = Drupal.dialog($dialog, response.dialogOptions);
+    var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions);
     if (response.dialogOptions.modal) {
       dialog.showModal();
     }
@@ -125,7 +125,7 @@
   Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) {
     var $dialog = $(response.selector);
     if ($dialog.length) {
-      Drupal.dialog($dialog).close();
+      Drupal.dialog($dialog.get(0)).close();
       if (!response.persist) {
         $dialog.remove();
       }
diff --git a/core/modules/ckeditor/js/ckeditor.admin.js b/core/modules/ckeditor/js/ckeditor.admin.js
index d519d66f7c46b92eb160de166c6e183c56b7c366..0e8f5b1051446221db01215a46ffd7891179c7b7 100644
--- a/core/modules/ckeditor/js/ckeditor.admin.js
+++ b/core/modules/ckeditor/js/ckeditor.admin.js
@@ -1345,7 +1345,8 @@ function openGroupNameDialog (view, $group, callback) {
   }
 
   // Create a Drupal dialog that will get a button group name from the user.
-  var dialog = Drupal.dialog(Drupal.theme('ckeditorButtonGroupNameForm'), {
+  var $ckeditorButtonGroupNameForm = $(Drupal.theme('ckeditorButtonGroupNameForm'));
+  var dialog = Drupal.dialog($ckeditorButtonGroupNameForm.get(0), {
     title: Drupal.t('Button group name'),
     dialogClass: 'ckeditor-name-toolbar-group',
     resizable: false,
diff --git a/core/modules/edit/js/util.js b/core/modules/edit/js/util.js
index 6e1aaab6ad1d8699894ba4154ba0cf6e5ade3330..da7656e37dfeb5970b325c416d7b035687d19c2d 100644
--- a/core/modules/edit/js/util.js
+++ b/core/modules/edit/js/util.js
@@ -41,7 +41,8 @@ Drupal.edit.util.buildUrl = function (id, urlFormat) {
  *   The message to use in the modal dialog.
  */
 Drupal.edit.util.networkErrorModal = function (title, message) {
-  var networkErrorModal = Drupal.dialog('<div>' + message + '</div>', {
+  var $message = $('<div>' + message + '</div>');
+  var networkErrorModal = Drupal.dialog($message.get(0), {
     title: title,
     dialogClass: 'edit-network-error',
     buttons: [
diff --git a/core/modules/edit/js/views/AppView.js b/core/modules/edit/js/views/AppView.js
index 93caf5c0c94e9d7841cc80143cd2c815b5f65c30..ba65c3ee65b675ed42537c53539c6259144e5097 100644
--- a/core/modules/edit/js/views/AppView.js
+++ b/core/modules/edit/js/views/AppView.js
@@ -350,7 +350,8 @@ Drupal.edit.AppView = Backbone.View.extend({
 
     // Only instantiate if there isn't a modal instance visible yet.
     if (!this.model.get('activeModal')) {
-      discardDialog = Drupal.dialog('<div>' + Drupal.t('You have unsaved changes') + '</div>', {
+      var $unsavedChanges = $('<div>' + Drupal.t('You have unsaved changes') + '</div>');
+      discardDialog = Drupal.dialog($unsavedChanges.get(0), {
         title: Drupal.t('Discard changes?'),
         dialogClass: 'edit-discard-modal',
         resizable: false,