[TextField] InputProps vs inputProps confusion
See original GitHub issueThe TextField (nor Input) does not pass the step property through to the input as a step attribute.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
<Textfield type="number" step="0.01" />
renders a <input type="number" step="0.01" />
Current Behavior
<Textfield type="number" step="0.01" />
renders a <input type="number" />
Steps to Reproduce (for bugs)
- Go to https://codesandbox.io/s/lyxw254vz9
- Click on the up/down arrows on right of textbox and see differences in behaviour
Context
Your Environment
Tech | Version |
---|---|
Material-UI | 1.0.0.rc0 |
React | 16 |
browser | Safari - Not possible to insert 0.xx number and pass validation. Chrome accepts 0.xx number and validates it but step is still by unit |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:27
- Comments:23 (18 by maintainers)
Top Results From Across the Web
inputProps vs InputProps in MUI TextField - reactjs
InputProps applies to Input react-component since: TextField is composed of smaller components ( FormControl, Input, FilledInput, ...
Read more >TextField API - Material UI
Name Type Default
autoComplete string
autoFocus bool false
classes object
Read more >inputProps vs InputProps
inputProps vs InputProps ... TextField.js. index.js ... VS Code's tsserver was deleted by another application such as a misbehaving virus detection tool.
Read more >تويتر \ التغريدات مع الردود بواسطة Material UI (MaterialUI@)
[TextField] InputProps vs inputProps confusion · Issue #11377 · mui/material-ui. The TextField (nor Input) does not pass the step property through to the ......
Read more >ng-content vs Input props : r/Angular2
I use both of these methods when building components for my libraries. I'm a bit confused on your intended use as I don't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
didn’t test, but I guess you should use
<TextField inputProps={{step: 0.01}} />
instead? It#s a prop on Input instead of TextField.update: sry, just checked your sandbox 😄 you already came up with that. What#s the problem with the inputProps solution? I guess there are more props we don’t pass down automagically: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement so it might be consistent to not do it at all.
@mnajdova I’m not sure what the right terminology is. From my perspective, props are first applied to the element, then made available in the component’s render method.
At this point, I would either propose:
input
→htmlInput
to match thehtmlFor
(React),htmlColor
(Icon component) props convention.We can likely do these two changes.