diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index 6d61d0c..c857190 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -165,7 +165,7 @@ public function processForm($element, FormStateInterface $form_state, $form) {
   public function afterBuild(array $element, FormStateInterface $form_state) {
     // Rebuild the entity if #after_build is being called as part of a form
     // rebuild, i.e. if we are processing input.
-    if ($form_state->isProcessingInput()) {
+    if ($form_state->isProcessingInput() && $form_state->isSubmitted()) {
       $this->entity = $this->buildEntity($element, $form_state);
     }
 
