diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
index 4f101a0..ca5b616 100644
--- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
+++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
@@ -11,6 +11,11 @@
 use Drupal\Component\Plugin\PluginManagerBase;
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Ajax\CloseModalDialogCommand;
+use Drupal\Core\Ajax\InsertCommand;
+use Drupal\Core\Ajax\OpenModalDialogCommand;
+use Drupal\Core\Ajax\PrependCommand;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityInterface;
@@ -311,6 +316,12 @@ public function form(array $form, FormStateInterface $form_state) {
       '#value' => $this->t('Save'),
     );
 
+    // Add container to hold elements rendered in modal form. These need to be
+    // inside the <form> tag so they are submitted when AJAX data is posted.
+    $form['modal'] = array(
+      '#markup' => '<div id="drupal-modal">&nbsp;</div>',
+    );
+
     $form['#attached']['library'][] = 'field_ui/drupal.field_ui';
 
     return $form;
@@ -741,6 +752,12 @@ public function multistepAjax($form, FormStateInterface $form_state) {
       case 'edit':
         $updated_rows = array($trigger['#field_name']);
         $updated_columns = array('plugin');
+
+        $markup = drupal_render($form['fields'][$trigger['#field_name']]['plugin']);
+        $response = new AjaxResponse();
+        $response->addCommand(new OpenModalDialogCommand($this->t('Edit formatter settings'), $markup));
+        return $response;
+
         break;
 
       case 'update':
@@ -764,7 +781,14 @@ public function multistepAjax($form, FormStateInterface $form_state) {
     }
 
     // Return the whole table.
-    return $form['fields'];
+    $response = new AjaxResponse();
+    $response->addCommand(new CloseModalDialogCommand());
+    $response->addCommand(new InsertCommand(NULL, drupal_render($form)));
+    $status_messages = array('#theme' => 'status_messages');
+    if ($messages = drupal_render($status_messages)) {
+      $response->addCommand(new PrependCommand(NULL, $messages));
+    }
+    return $response;
   }
 
   /**
