question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. <TextField defaultValue=“Hello” variant=“outlined” InputProps={{ disableUnderline: true }} />
  2. #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:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
oliviertassinaricommented, Jul 9, 2020

Note that disableUnderline is only supported by the filled and standard text fields. It’s not supported by the outlined variant.

6reactions
joshwoodingcommented, Apr 26, 2019

Can you follow and fill out the issue template please. A code example is ideal as well.

I would make sure you are using InputProps instead of inputProps capitalisation is important here.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found