- Issue created by @artis.bajars
With the introduction of
#3463796 Ensure sticky action buttons to work with modals and ajax refresh-calls
🐛
Ensure sticky action buttons to work with modals and ajax refresh-calls
Needs review
and entity form action buttons becoming <label>
elements there is no longer a visible progress indicator when an ajax callback is attached to an action button. Is there a way to restore this functionality?
- Install gin 8.x-3.0-rc14, set as admin theme
- Attach an ajax callback to e.g. the node form "Preview" button
- Observe that no progress indicator is visible:
/**
* Implements hook_form_FORM_ID_alter().
*/
function ajax_example_form_node_form_alter(&$form, FormStateInterface $form_state) {
$form['actions']['preview']['#ajax'] = [
'callback' => 'ajax_example_form_node_form_preview_callback',
'event' => 'click',
'progress' => [
'type' => 'throbber',
'message' => 'Processing...',
],
];
}
/**
* Form submission handler for the 'preview' action.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/
function ajax_example_form_node_form_preview_callback(array $form, FormStateInterface $form_state) {
$response = new AjaxResponse();
$response->addCommand(new AlertCommand('Do you see this?'));
return $response;
}
Active
3.0
Code