Skip to content

Commit

Permalink
Merge pull request #23 from demianottema/main
Browse files Browse the repository at this point in the history
Added fix for empty stings in a query (#18)
  • Loading branch information
pelmered authored Apr 24, 2024
2 parents 4240ed5 + 94082c1 commit e763d2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Forms/Components/MoneyInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ protected function setUp(): void
return MoneyFormatter::formatAsDecimal($state, $currency, $locale);
});

$this->dehydrateStateUsing(function (MoneyInput $component, $state): string {

$this->dehydrateStateUsing(function (MoneyInput $component, $state): ?string {
$currency = $component->getCurrency();
$state = MoneyFormatter::parseDecimal($state, $currency, $component->getLocale());

$this->prepare();

if (empty($state)) {
return null;
}

return $state;
});
}
Expand Down

0 comments on commit e763d2e

Please sign in to comment.