diff --git a/src/Controls/CheckboxListEnum.php b/src/Controls/CheckboxListEnum.php index bfd53d0..4ddd1f6 100644 --- a/src/Controls/CheckboxListEnum.php +++ b/src/Controls/CheckboxListEnum.php @@ -65,7 +65,7 @@ public function setValue(/*?LabeledEnum*/ $values): self $values = Arrays::map($values, function(mixed $value) { if (isset($value) && !$value instanceof $this->enumType) { - $value = $this->enumType::make($value); + $value = $this->enumType::make($value, $value !== ''); } return $value?->value; diff --git a/src/Controls/RadioListEnum.php b/src/Controls/RadioListEnum.php index a90caa0..25057f6 100644 --- a/src/Controls/RadioListEnum.php +++ b/src/Controls/RadioListEnum.php @@ -60,7 +60,7 @@ public function setItems(array $enums, bool $useKeys = true): self public function setValue(/*?LabeledEnum*/ $value): self { if (isset($value) && !$value instanceof $this->enumType) { - $value = $this->enumType::make($value); + $value = $this->enumType::make($value, $value !== ''); } return parent::setValue($value?->value ?? null); diff --git a/src/Controls/SelectBoxEnum.php b/src/Controls/SelectBoxEnum.php index b879f8d..4f6b205 100644 --- a/src/Controls/SelectBoxEnum.php +++ b/src/Controls/SelectBoxEnum.php @@ -55,7 +55,7 @@ public function setItems(array $enums, bool $useKeys = true, bool $badge = false public function setValue(/*?LabeledEnum*/ $value): self { if (isset($value) && !$value instanceof $this->enumType) { - $value = $this->enumType::make($value); + $value = $this->enumType::make($value, $value !== ''); } return parent::setValue($value?->value ?? null);