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);
Thank you for posting this. I was pulling what remains of my hair out. 🍻