nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
22.02k stars 1.54k forks source link

[BUG] - Input Component Type 'number' Only Accepts A String Value #3448

Open alexwasik opened 4 months ago

alexwasik commented 4 months ago

NextUI Version

2.4.2

Describe the bug

When using the Input Component it will accept type='number' but you cannot pass a value or defaultValue type of Number. If you pass the numeric value as a String to the Input number type, you cannot use the up/down arrows to modify that number

<Input label='Household Income' type='number' value={clientIncome} />

Screenshot 2024-07-11 at 11 24 28 AM

<Input label='Household Income' type='number' value={String(clientIncome)} />

Screenshot 2024-07-11 at 11 25 06 AM

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Use Input Component, add type='number' and any numeric value (value={1}) or pass in a variable that is a number

Expected behavior

As a user, I expect to be able to pass in a number to an Input with type number and be able to use the up/down errors to change that value. Instead I am required to pass in a string that is not modifiable using those arrows

Screenshots or Videos

No response

Operating System Version

OS: MacOS

Browser

Chrome

linear[bot] commented 4 months ago

ENG-1127 [BUG] - Input Component Type 'number' Only Accepts A String Value