wfp / designsystem

World Food Programme User Interface Kit. Developer kit for implementing WFP web style guideline.
http://www.wfp.org/UIGuide
Apache License 2.0
221 stars 103 forks source link

Wrong type definition for NumberInput - step prop #513

Closed gguidotti closed 2 years ago

gguidotti commented 2 years ago

Detailed description

Describe in detail the issue you're having. When using the NumberInput component, if I use a number as the "step" prop (eg. ) everything works just fine. However, in order to use a decimal NumberInput, I had to pass "step" prop a decimal value. Passing in a number (step={0.2}) I get a console error about value.split not being a function, while passing in a string (step="0.1") works fine but gives me a console warning about wrong typings (expecting a number but getting a string instead).

Is this issue related to a specific component? NumberInput

What did you expect to happen? What happened instead? What would you like to see changed? Enrich type definition by covering both "number" and "string"? No warning shown.

What version of the WFP UI (Carbon Design System) are you using? @wfp/ui@1.20.10

gguidotti commented 2 years ago

Can confirm issue was fixed in 1.20.11 release. Thanks!