We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c28a561 commit a539480Copy full SHA for a539480
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