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.

fullWidth issue in TextField

See original GitHub issue

packages / text-field / index.js / line no. 267, 268, 269

{label && !fullWidth ? this.renderLabel() : null} {outlined ? this.renderNotchedOutline() : null} {!fullWidth && !textarea && !outlined ? this.renderLineRipple() : null}

if fullWidth true then label should not be null and same for the lineRipple. if fullWidth = true then everything should be same only the length of the textbox should be 100% of the parent box. please look into it… (though in material-components-web the textfield’s behaviour is identical to this lib but logically nothing should change except width) @moog16 @bonniezhou

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
qs-labscommented, Jun 7, 2019

The only clarifier I would add to this is the MDC Web Text Field demo includes two ‘fullWidth’ text fields that both preserve the label, which admittedly led to some confusion on my end.

1reaction
moog16commented, Oct 26, 2018

@souvanjana, yes this is by design. MDC React is built to match MDC Web, so we wouldn’t change the logic here. I see how it can be confusing, but if you need it to be a regular text field and take the full screen width, can you use width: 100%? Like so:

.your-mdc-text-field-fullwidth-class-name {
  width: 100%;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

TextField doesn't render when fullWidth is true - Stack Overflow
I have a React application and I am using Material react-text-field. For some reason when I mark fullWidth as true , only the...
Read more >
TextField fullWidth doesn't work when parent is flex item with ...
TextField fullWidth doesn't work when parent is flex item with no explicit width #12445. component: text field.
Read more >
Full-width input field - W3Schools Tryit Editor
input { width: 100%; } </style> </head> <body> ​ <h2>A full-width input field</h2> ​ <form> <label for="fname">First Name</label>
Read more >
Input API - Material UI - MUI
Name Type Default autoComplete string autoFocus bool false classes object
Read more >
How to Set MUI TextField Height and Width: The 3 Best Ways
Perhaps the simplest way to set TextField width and height is to use only the sx prop. First, set width at the root...
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