diff --git a/inline_entity_menu_form.module b/inline_entity_menu_form.module
index 01736bf..25ee3ab 100644
--- a/inline_entity_menu_form.module
+++ b/inline_entity_menu_form.module
@@ -35,10 +35,16 @@ function inline_entity_menu_form_form_alter(&$form, FormStateInterface $form_sta
     'menu_link_content_' . $formName . '_delete_form',
   ], true)) {
     $input = $form_state->getUserInput();
-    if (!empty($input['_drupal_ajax'] && Drupal::request()->get('_wrapper_format') !== 'drupal_ajax' )) {
+    if (!empty($input['_drupal_ajax'])) {
       $form['actions']['submit']['#submit'][] = '_inline_entity_menu_form_ajax_submit_reopen';
-      $form['actions']['submit']['#attributes']['class'][] = 'use-ajax';
+      $form['actions']['submit']['#attributes']['class'][] = 'use-ajax-submit';
       $form['actions']['delete']['#access'] = FALSE;
+      if(isset( $form['actions']['delete'])) {
+        $form['actions']['delete']['#access'] = FALSE;
+      }
+      if(isset( $form['actions']['cancel'])) {
+        $form['actions']['cancel']['#access'] = FALSE;
+      }
     }
   }
 }
diff --git a/src/MenuFormLB.php b/src/MenuFormLB.php
index f86f801..f0e0717 100644
--- a/src/MenuFormLB.php
+++ b/src/MenuFormLB.php
@@ -4,7 +4,7 @@ namespace Drupal\inline_entity_menu_form;

 use Drupal\Component\Serialization\Json;
 use Drupal\Core\Ajax\AjaxResponse;
-use Drupal\Core\Ajax\CloseModalDialogCommand;
+use Drupal\Core\Ajax\CloseDialogCommand;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\menu_ui\MenuForm;
@@ -68,7 +68,7 @@ class MenuFormLB extends MenuForm {
             'data-dialog-type' => 'dialog',
             'data-dialog-options' => Json::encode([
               'width' => 700,
-              'modal' => TRUE,
+              'modal' => FALSE,
               'target' => 'drupal-dialog',
               'autoResize' => TRUE,
             ])
@@ -96,7 +96,7 @@ class MenuFormLB extends MenuForm {
    */
   function close_dialog_ajax_submit(array $form, FormStateInterface &$form_state) {
     $response = new AjaxResponse();
-    $response->addCommand(new CloseModalDialogCommand());
+    $response->addCommand(new CloseDialogCommand());
     $form_state->setResponse($response);
   }
 }
