Skip to content

Commit bebd206

Browse files
authored
Update AjaxSelect.php
1 parent 9a9e7d7 commit bebd206

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Form/AjaxSelect.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ public function __construct(?string $label, callable $callback)
2828

2929
public function getValue()
3030
{
31-
$this->setValue($this->value);
31+
if (!\in_array($this->value, [null, '', []], true)) {
32+
$this->setValue($this->value);
33+
}
34+
3235
return \array_key_exists($this->value, $this->getItems()) ? $this->value : null;
3336
}
3437
}

0 commit comments

Comments
 (0)