From df8892bfafa707ff549affe42f3726db78cf0f0e Mon Sep 17 00:00:00 2001 From: Peter Elmered Date: Wed, 24 Apr 2024 09:49:34 +0200 Subject: [PATCH] Return null for non numeric values when dehydrating states. Should properly fix #18 --- src/Forms/Components/MoneyInput.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Forms/Components/MoneyInput.php b/src/Forms/Components/MoneyInput.php index 7e262e7..cf0340c 100644 --- a/src/Forms/Components/MoneyInput.php +++ b/src/Forms/Components/MoneyInput.php @@ -39,10 +39,10 @@ protected function setUp(): void $currency = $component->getCurrency(); $state = MoneyFormatter::parseDecimal($state, $currency, $component->getLocale()); - if (empty($state)) { + if (!is_numeric($state)) { return null; } - + return $state; }); }