-
Hi, I noticed when I use the Input component with type number that I am still able to type non-numeric values. I see your note that you don’t support HTML input[type="number"]. How else can I validate user entered data? Thanks for your answer! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @dsnair, Unfortunately, From Paste's side of things, we setup Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi @dsnair,
Unfortunately,
<input type="number" />
doesn't prevent typing letters. In Firefox you can type any letter, and in Chrome you can still typee
. You can try it here: https://codesandbox.io/s/input-type-number-oqsybb?file=/src/App.js.From Paste's side of things, we setup
, or have no separation at the thousand mark. There are many little nuances to input validation. As such, it is impossible for us to do it be…
<Input type="number"
to correctly display the right settings for screen readers and mobile keyboards. Any input validation must be done by whoever implements our component, as it's hard to know how to validate generically. For example, currencies may be separated by,
,.
,