Skip to content

Commit

Permalink
Form // set "submitted"-state in Form::submit() after inputData is as…
Browse files Browse the repository at this point in the history
…sigend to Elements.
  • Loading branch information
Chrico committed Sep 19, 2023
1 parent bb27332 commit 8c2cfb2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Element/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function withData(array $data = []): static
*/
public function submit(array $inputData = [])
{
$this->isSubmitted = true;
$this->isValid = true;

foreach ($this->elements() as $name => $element) {
Expand All @@ -58,6 +57,9 @@ public function submit(array $inputData = [])
$this->isValid = false;
}
}

// Submitted state is set on the end after all values are assigned.
$this->isSubmitted = true;
}

/**
Expand Down

0 comments on commit 8c2cfb2

Please sign in to comment.