From 365452be9e1eb89c4df5b84a85fb040eac55dbc3 Mon Sep 17 00:00:00 2001
From: Lee Rowlands <lee.rowlands@previousnext.com.au>
Date: Tue, 12 Jul 2022 08:07:46 +1000
Subject: [PATCH] Issue #2588013 by sumthief, aneek, tic2000, droplet, nod_,
 GuyPaddock, arunkumark, Manjit.Singh, anil280988, Wim Leers, larowlan,
 Lendude: <span class="ajax-new-content" style="display:inline-block;"> causes
 unwanted whitespace

---
 core/modules/file/src/Element/ManagedFile.php | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/core/modules/file/src/Element/ManagedFile.php b/core/modules/file/src/Element/ManagedFile.php
index e198f353dc8f..8672aba730be 100644
--- a/core/modules/file/src/Element/ManagedFile.php
+++ b/core/modules/file/src/Element/ManagedFile.php
@@ -194,10 +194,6 @@ public static function uploadAjaxCallback(&$form, FormStateInterface &$form_stat
     if (isset($form['#file_upload_delta']) && $current_file_count < $form['#file_upload_delta']) {
       $form[$current_file_count]['#attributes']['class'][] = 'ajax-new-content';
     }
-    // Otherwise just add the new content class on a placeholder.
-    else {
-      $form['#suffix'] .= '<span class="ajax-new-content"></span>';
-    }
 
     $status_messages = ['#type' => 'status_messages'];
     $form['#prefix'] .= $renderer->renderRoot($status_messages);
-- 
GitLab