See https://www.drupal.org/project/drupal/issues/3089751 & https://www.drupal.org/forum/support/theme-development/2018-12-08/prevent-form-actions-from-appearing-in-a-modal-dialog
In mytheme.libraries.yml
dialog.ajax:
js:
path/to/js/dialog.ajax.js: { minified: true }
In mytheme.info.yml
libraries-extend:
core/drupal.dialog.ajax:
- mytheme/dialog.ajax
Create a file called path/to/js/dialog.ajax.js
in your theme, with the following content :
(function (Drupal) {
// Override core/dialog.ajax prepareDialogButtons behaviors
Drupal.behaviors.dialog.prepareDialogButtons = function prepareDialogButtons($dialog) {
// Do nothing = do not put buttons into dialog footer
return [];
}
})(Drupal);
I've come up with a better solution, you can selectively add a class to your $form['actions']['#attributes']['class'][] = 'disable-dialog-buttons'; to disable this functionality on a per form basis...