I have a bug in my application. It's a currency converting app - and it should only accept numbers.
I wrote an application that takes numbers from input. It works perfectly fine on Chrome, but firefox allows me/user to type in any character. I tried all kinds of methods, and functions to prevent this behavior - such as regex functions with tests to see if e.target.value is a number or not, pattern="[0-9]", inputype='numeric' and a few more.
<input type="number" onChange={e => setFromTo(e.target.value)} />
Does anybody know how to prevent firefox input field from accepting any character, and only taking in numbers?