We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c28a561 + a539480 commit 6135523Copy full SHA for 6135523
src/@next/CurrencyInput/CurrencyInput.tsx
@@ -85,7 +85,7 @@ export const CurrencyInput = React.forwardRef<
85
return '$';
86
};
87
88
- const formattedValue = formatter.format(getRawNumber(value.toString()));
+ const formattedValue = formatter.format(getRawNumber(value.toString())) ?? '';
89
90
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
91
const rawValue = getRawNumber(e.currentTarget.value);
@@ -102,7 +102,7 @@ export const CurrencyInput = React.forwardRef<
102
</div>
103
}
104
{...props}
105
- value={formattedValue === '0' ? '' : formattedValue}
+ value={formattedValue}
106
onChange={handleChange}
107
/>
108
);
0 commit comments