fix(admin): Price input (#4530)

* initial fix for number inputs

* add changeset
This commit is contained in:
Philip Korsholm
2023-07-14 10:45:23 +02:00
committed by GitHub
parent 43427b8893
commit 55db914151
4 changed files with 22 additions and 13 deletions

View File

@@ -1,7 +1,9 @@
import * as React from "react"
import { CurrencyType } from "../../../utils/currencies"
import PriceInput, { PriceInputProps } from "../price-input"
import { CurrencyType } from "../../../utils/currencies"
type MedusaPriceInputProps = {
amount: number
currency: CurrencyType
@@ -34,7 +36,7 @@ function MedusaPriceInput(props: MedusaPriceInputProps) {
const numericalValue = Math.round(floatValue * 10 ** decimal_digits)
onChange(numericalValue)
} else {
onChange(undefined)
onChange(null)
}
setRawValue(value)
}