{"id":130,"date":"2022-07-22T04:21:07","date_gmt":"2022-07-22T04:21:07","guid":{"rendered":"https:\/\/blog.keenforms.com\/?p=130"},"modified":"2022-07-22T14:54:33","modified_gmt":"2022-07-22T14:54:33","slug":"why-the-number-input-is-the-worst-input","status":"publish","type":"post","link":"https:\/\/blog.keenforms.com\/blog\/why-the-number-input-is-the-worst-input\/","title":{"rendered":"Why the number input is the worst input"},"content":{"rendered":"

I recently shared a post on hacker news<\/a> about the app I\u2019ve been building (keenforms<\/a>). It actually sparked a lively discussion, although the most heated issue was not really about my product. It was about the <input type=\u201dnumber\u201d>, or rather the fact that we\u2019re not using it.<\/span><\/p>\n

At some point early on I tried using the number input in the form rendering page, but I ran into so many problems that it was just easier and more predictable to avoid it completely. We just use the <input type=\u201dtext\u201d> for number data types, and use javascript to validate the value. <\/span><\/p>\n

*Please note that we actually do use <input type=”number”> inside our app. However we only use it in the dashboard, for fields form attribute files such as position and score multiplier, because those validations are unconditional.<\/span><\/p>\n

I discovered a lot of odd behavior when you use <input type=\u201dnumber\u201d>, but it never occurred to me to share all the problems I ran into. That is, until the hacker news post comments.<\/span><\/p>\n

The pro number input crowd was primarily focused on the accessibility argument. The number input has the native increment\/decrement buttons. It has built in validation as well. Some mobile devices will show a number keypad instead of the full keyboard.<\/span><\/p>\n

There were also some complaints about developers overusing Javascript (guilty!). Keenforms relies heavily on javascript and specifically React, and Javascript is critical to the dynamic interactions that can be created using our software. I understand some people\u2019s aversion to JavaScript. However JavaScript is the only way to create a decent user experience with real time responses for the forms that Keenforms was built for. There is no other way to provide the kind of real time dynamic feedback I wanted for Keenforms without JavaScript. If you want a form builder that will render properly for users who have disabled JavaScript, then you shouldn’t use Keenforms.<\/span><\/p>\n

However I was not alone in the anti-number input camp. One user posted an article issued by the UK Government detailing all the problems related to the number input.<\/span><\/p>\n

https:\/\/technology.blog.gov.uk\/2020\/02\/24\/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers\/<\/span><\/a><\/p>\n

The mind blowing thing about this article is;<\/span><\/p>\n