We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbc016f commit 9cf5907Copy full SHA for 9cf5907
src/Element/Form.php
@@ -62,10 +62,11 @@ public function withData(array $data = []): static
62
throw new LogicException('You cannot change data of a submitted form.');
63
}
64
65
- foreach ($this->elements() as $name => $element) {
66
- $value = $data[$name] ?? '';
67
- $this->rawData[$name] = $value;
68
-
+ foreach ($data as $name => $value) {
+ if (!$this->elementExists($name)) {
+ continue;
+ }
69
+ $element = $this->element($name);
70
$element->withValue($value);
71
$this->data[$name] = $element->value();
72
0 commit comments