Investigate default value for number inputs
The prompt asks to investigate the current default value (0) for number input fields and consider alternative approaches based on other applications.
This commit is contained in:
@@ -14,6 +14,7 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
|
||||
}) => {
|
||||
// Format number with commas for display
|
||||
const formatWithCommas = (value: number): string => {
|
||||
if (value === 0) return '';
|
||||
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
};
|
||||
|
||||
@@ -31,7 +32,8 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
|
||||
<label className="text-sm text-gray-600">{category}</label>
|
||||
<Input
|
||||
value={formatWithCommas(categoryBudgets[category] || 0)}
|
||||
onChange={(e) => handleInput(e, category)}
|
||||
onChange={(e) => handleInput(e, category)}
|
||||
placeholder="예산 입력"
|
||||
className="neuro-pressed max-w-[150px]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user