TextField ignores prop InputProps{disableUnderline} and passes it down to DOM element.
See original GitHub issue- This is not a v0.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior 🤔
<TextField defaultValue="Hello" variant="outlined" InputProps={{ disableUnderline: true }} />
Docs say should remove the underline from the nested Input Field.
Current Behavior 😯
Either TextField or Input is ignoring the prop. React Errors: “React does not recognize the disableUnderline prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase disableunderline instead. If you accidentally passed it from a parent component, remove it from the DOM element.”
Similar to #13717 But looks like they only addressed TextField variant ‘filled’.
Still exists @material-ui/core": “3.9.3”
Steps to Reproduce 🕹
Link:
- <TextField defaultValue=“Hello” variant=“outlined” InputProps={{ disableUnderline: true }} />
- #13717
Context 🔦
Just trying to render a TextField variant=“outlined” without it underlining the input field, without hacking the css.
Your Environment 🌎
| Tech | Version |
|---|---|
| Material-UI | v3.9.3 |
| React | 16.8.3 |
| Browser | Chrome |
| TypeScript | |
| etc. |
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
TextField ignores prop InputProps{disableUnderline ... - GitHub
TextField ignores prop InputProps {disableUnderline} and passes it down to ... does not recognize the disableUnderline prop on a DOM element.
Read more >Material-UI React does not recognize the `underlineStyle ...
To solve it, you need to override shouldForwardProp callback and filter out props that shouldn't be passed to the DOM elements:
Read more >Material UI — More Text Field Customization - Morioh
We can customize a text field by passing our own style to it. TextField has an InputProps prop which takes an object with...
Read more >Design Patterns with React Easy State | by Bertalan Miklos
React Easy State is a transparent reactive state management library with two functions and two accompanying rules. Always wrap your components with view()...
Read more >CHANGELOG.md - TINMAN
Allow accessing the component's props from within the style object. ... (#12734) @mblodorn - [docs] Explain how to pass props down to overridden...
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 Free
Top 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

Note that
disableUnderlineis only supported by the filled and standard text fields. It’s not supported by the outlined variant.Can you follow and fill out the issue template please. A code example is ideal as well.
I would make sure you are using
InputPropsinstead ofinputPropscapitalisation is important here.