-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
design: materialThis is about Material Design, please involve a visual or UX designer in the processThis is about Material Design, please involve a visual or UX designer in the processlinked in docsThe issue is linked in the docs, so completely skew the upvotes.The issue is linked in the docs, so completely skew the upvotes.scope: number fieldChanges related to the number field.Changes related to the number field.type: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.waiting for 👍Waiting for upvotes. Open for community feedback and needs more interest to be worked on.Waiting for upvotes. Open for community feedback and needs more interest to be worked on.
Description
I noticed in the Material-UI's roadmap a Numeric Input component to be built. If nobody has took the lead then I can help. Recently I had to develop a component like that for a personal project (first screenshot below).
- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
I didn't look deeply but I think about a <NumericField /> wrapping a <TextField />. This text field component would render the step buttons.
Examples 🌈
Motivation 🔦
Sometimes we want to force an input to only accept numbers, but the support for type="number" has limitations:
- Firefox and Safari are allowing to type any value, even non-digit characters Textfield type="number" allowing non-numeric values in firefox #18923
- Chrome allows entering any amount when
maxis set: [TextField] type=number missing min, max, step Typescript types #9313 (comment). It should likely round to the max when blurring the field. - Chrome allows chars like
e, [TextField] type="number" limitations #10582. - Using the mouse wheel changes the value, instead of scrolling [TextField] type="number" limitations #10582 (comment), [TextField] How to prevent mousewheel in input of type number? #7960
TODO
- Update: https://mui.com/material-ui/react-text-field/#type-quot-number-quot when this is released.
Benchmarks
https://mui-org.notion.site/Input-Number-component-364825a7bec94381809ac11ff05b4cc0
Misiu, kurtwilbies, oliviertassinari, miguelangeltorresfp, PacoVK and 408 moreAliakseiYakubuk, yanivtoledano, SabinaBasina, suzil, AnfalHussain and 106 morelounsbrough
Metadata
Metadata
Assignees
Labels
design: materialThis is about Material Design, please involve a visual or UX designer in the processThis is about Material Design, please involve a visual or UX designer in the processlinked in docsThe issue is linked in the docs, so completely skew the upvotes.The issue is linked in the docs, so completely skew the upvotes.scope: number fieldChanges related to the number field.Changes related to the number field.type: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.waiting for 👍Waiting for upvotes. Open for community feedback and needs more interest to be worked on.Waiting for upvotes. Open for community feedback and needs more interest to be worked on.

