Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumberInput component #227

Open
aldeed opened this issue Aug 16, 2018 · 0 comments
Open

NumberInput component #227

aldeed opened this issue Aug 16, 2018 · 0 comments

Comments

@aldeed
Copy link
Contributor

aldeed commented Aug 16, 2018

NumberInput

Overview / Summary

The NumberInput is the same as TextInput, but the value prop is expected to be PropTypes.number and the type prop allowed values are "number" and "tel". It need not have the logic for using a textarea.

Rationale for why this component is necessary

The TextInput receives and outputs string values. For forms that have you enter numeric values, this means we currently need to transform the values to strings or there are errors. It's best if we don't complicate TextInput too much with number parsing logic, and it's clearer anyway if there is a separate component.

Images / Designs of UI component in context

It should look identical to TextInput. Only the value types are different. Based on "number" or "tel" type, the keyboard on mobile devices will look different, but that is handled automatically by the browser/OS.

Render Criteria

Always render an HTML input. Like the TextInput render function, but without textarea logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant