I am having an AJAX kind, which on submit fires a callback operate the place I need to connect my library.
Here is Drupal Development Company submit button:
$kind['actions']['submit'] = [ '#type' => 'submit', '#value' => 'Submit', '#button_type' => 'primary', '#name' => 'calculate', '#submit' => ['::submitForm'], '#ajax' => [ 'callback' => [$this, 'submitFormCallback'], 'wrapper' => 'my-form-id', ], ];
When Drupal Development Company submitFormCallback is known as I connect my library utilizing AjaxResponse and its addAttachments like this:
$ajax_response->addAttachments([ 'library' => ['my_module/library_name'] ]);
Drupal Development downside is when Drupal Development Company AJAX is accomplished Drupal Development Company complete web page’s format is destroyed. Once I do NOT connect Drupal Development Company library to AJAX response all the things appears to work wonderful. (I’ve already tried to empty my JS recordsdata in my_module/library_name so Drupal Development Company javascript will not have an effect on any DOM parts, however Drupal Development Company result’s Drupal Development Company similar.
Is there any downside with Drupal Development Company means I connect Drupal Development Company library to AjaxResponse that will trigger Drupal Development Company damaged format?