Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / file / src / Element / ManagedFile.php
index 6f01ee552e979a3539b8e64acb8045c1d4ed5972..95798c6734de0c3f48efe759d61cc382392a3212 100644 (file)
@@ -299,6 +299,10 @@ class ManagedFile extends FormElement {
 
       // Add the upload progress callback.
       $element['upload_button']['#ajax']['progress']['url'] = Url::fromRoute('file.ajax_progress', ['key' => $upload_progress_key]);
+
+      // Set a custom submit event so we can modify the upload progress
+      // identifier element before the form gets submitted.
+      $element['upload_button']['#ajax']['event'] = 'fileUpload';
     }
 
     // The file upload field itself.