I am using Modal as display, and Acquia DAM as widget plugin. I too want this...

Contribution Date
Technology
Contribution Project
Contribution Details

I am using Modal as display, and Acquia DAM as widget plugin. I too want this feature.

I was partially able to fix it by adding an ajax callback inside the form builder getForm().

public function getForm(array &$original_form, FormStateInterface $form_state, array $additional_widget_parameters) { // code.. $form['actions']['submit']['#ajax'] = [ 'callback' => '\Drupal\media_acquiadam\Plugin\EntityBrowser\Widget\Acquiadam::ajaxSubmit', ]; } public function ajaxSubmit(array &$form, FormStateInterface $form_state) { $response = new AjaxResponse(); $response->addCommand(new CloseModalDialogCommand()); return $response; }

the problem is it does not closes the modal. I am figuring out if there is a better way to do this.

Contribution Author
Files count
0
Patches count
0