diff --git a/clients/packages/polarkit/src/components/ui/atoms/MoneyInput.tsx b/clients/packages/polarkit/src/components/ui/atoms/MoneyInput.tsx index ee4df77322..66802e406f 100644 --- a/clients/packages/polarkit/src/components/ui/atoms/MoneyInput.tsx +++ b/clients/packages/polarkit/src/components/ui/atoms/MoneyInput.tsx @@ -1,5 +1,5 @@ import { AttachMoneyOutlined } from '@mui/icons-material' -import { ChangeEvent, FocusEvent, useCallback, useState } from 'react' +import { ChangeEvent, FocusEvent, useCallback, useState, useEffect } from 'react' import { twMerge } from 'tailwind-merge' import Input from './Input' @@ -43,6 +43,12 @@ const MoneyInput = (props: Props) => { value ? (value / 100).toFixed(2) : undefined, ) + useEffect(() => { + if (value !== undefined) { + setInternalValue((value / 100).toFixed(2)) + } + }, [value]) + const onChange = useCallback( (e: ChangeEvent) => { if (_onChange) {