diff --git a/src/Form/PatternEditForm.php b/src/Form/PatternEditForm.php
index 1e8d86f..49efc7e 100644
--- a/src/Form/PatternEditForm.php
+++ b/src/Form/PatternEditForm.php
@@ -205,6 +205,7 @@ class PatternEditForm extends EntityForm {
     /** @var \Drupal\pathauto\PathautoPatternInterface $entity */
     $entity = parent::buildEntity($form, $form_state);
 
+    // Will only be used for new patterns.
     $default_weight = 0;
 
     $alias_type = $entity->getAliasType();
@@ -250,7 +251,9 @@ class PatternEditForm extends EntityForm {
 
     }
 
-    $entity->setWeight($default_weight);
+    if ($entity->isNew()) {
+      $entity->setWeight($default_weight);
+    }
 
     return $entity;
   }
diff --git a/src/Tests/PathautoUiTest.php b/src/Tests/PathautoUiTest.php
index 6503b36..a0bb436 100644
--- a/src/Tests/PathautoUiTest.php
+++ b/src/Tests/PathautoUiTest.php
@@ -129,8 +129,8 @@ class PathautoUiTest extends WebTestBase {
     $this->assertResponse(200);
     $this->assertEntityAlias($node, $alias);
 
-    // Edit workflow, set a new label for the pattern.
-    $this->drupalGet('/admin/config/search/path/patterns');
+    // Edit workflow, set a new label and weight for the pattern.
+    $this->drupalPostForm('/admin/config/search/path/patterns', ['entities[page_pattern][weight]' => '4'], t('Save'));
     $this->clickLink(t('Edit'));
     $this->assertUrl('/admin/config/search/path/patterns/page_pattern');
     $this->assertFieldByName('pattern', '[node:title]');
@@ -141,6 +141,8 @@ class PathautoUiTest extends WebTestBase {
     $edit = array('label' => 'Test');
     $this->drupalPostForm('/admin/config/search/path/patterns/page_pattern', $edit, t('Save'));
     $this->assertText('Pattern Test saved.');
+    // Check that the pattern weight did not change.
+    $this->assertOptionSelected('edit-entities-page-pattern-weight', '4');
 
     // Disable workflow.
     $this->drupalGet('/admin/config/search/path/patterns');
