Skip to content

Commit

Permalink
Fix validation for NumberField and FinalFormNumberInput (#2507)
Browse files Browse the repository at this point in the history
By calling the `onBlur` event, passed in by the `Field`.
  • Loading branch information
jamesricky authored Sep 5, 2024
1 parent 0ffec5a commit 91bfda9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-humans-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/admin": patch
---

Fix validation for `NumberField` and `FinalFormNumberInput` by calling the `onBlur` event, passed in by the `Field`
1 change: 1 addition & 0 deletions packages/admin/admin/src/form/FinalFormNumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function FinalFormNumberInput({ meta, input, innerRef, clearable, endAdor
);

const handleBlur = (event: FocusEvent<HTMLInputElement>) => {
input.onBlur(event);
const { value } = event.target;
const numberParts = intl.formatNumberToParts(1111.111);
const decimalSymbol = numberParts.find(({ type }) => type === "decimal")?.value;
Expand Down

0 comments on commit 91bfda9

Please sign in to comment.