contentful / forma-36

A design system by Contentful
https://f36.contentful.com
MIT License
333 stars 81 forks source link

💡 Proposal - Number input component #2160

Open bgutsol opened 2 years ago

bgutsol commented 2 years ago

Forma 36 contribution proposal

The problem

We provide only native input with type="number". But due to different browsers' implementation and known issue with React onChange callback (https://github.com/facebook/react/issues/6556) it's worth replicating the native number input logic with input type="text".

The proposed solution

Create a separate Number component that will replicate native number input validation and a11y controls. We've already implemented it in our field-editor-number: https://github.com/contentful/field-editors/pull/1203

Breaking changes

NO.

denkristoffer commented 2 years ago

Can we move the field editor over or is there additional work to be done?

bgutsol commented 2 years ago

Some adjusments need to be done to make it more generic and flexible.

github-actions[bot] commented 2 years ago

Marking issue as stale since there was no activity for 30 days