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 without label in outlined variant break outline at top

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

When I migrated from V4 to V5 all my text field that is outlined has no border at the top. The notch is visible even if I pass label null.

Expected behavior 🤔

I want an outlined input field without label

Steps to reproduce 🕹

Steps:

  1. Use a TextField
  2. Set variant='outlined'
  3. Pass no label or pass label={null}

Context 🔦

I want an outlined input field without label

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: Linux 5.11 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    Memory: 1.06 GB / 7.66 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.0 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.13 - /usr/local/bin/npm
  Managers:
    Apt: 2.0.6 - /usr/bin/apt
    pip3: 20.0.2 - /usr/bin/pip3
  Utilities:
    Make: 4.2.1 - /usr/bin/make
    GCC: 9.3.0 - /usr/bin/gcc
    Git: 2.25.1 - /usr/bin/git
    FFmpeg: 4.2.4 - /usr/bin/ffmpeg
  Servers:
    Apache: 2.4.41 - /usr/sbin/apachectl
  Virtualization:
    Docker: 20.10.12 - /usr/bin/docker
  IDEs:
    Nano: 4.8 - /usr/bin/nano
    VSCode: 1.63.2 - /snap/bin/code
  Languages:
    Bash: 5.0.17 - /usr/bin/bash
    Go: 1.13.8 - /usr/bin/go
    Perl: 5.30.0 - /usr/bin/perl
    Python: 2.7.18 - /usr/bin/python
    Python3: 3.8.10 - /usr/bin/python3
  Databases:
    MongoDB: 3.6.8 - /usr/bin/mongo
  Browsers:
    Brave Browser: 96.1.33.106
    Chrome: 96.0.4664.110
    Chromium: 96.0.4664.110
    Firefox: 95.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:23 (3 by maintainers)

github_iconTop GitHub Comments

25reactions
cfecherollecommented, Mar 23, 2022

For those who are struggling with this, here is a CSS code to fix things, based on moshfiqrony’s answer. Make sure it does not break any other part of your design, since in most cases it seems to come from Bootstrap styles, so maybe some of their intended styles will break because of this:

fieldset {
    legend {
        width: unset;
    }
}
24reactions
sumitapporiocommented, Jul 6, 2022

Try this for TextField or Select <TextField sx={{ ‘& legend’: { display: ‘none’ }, ‘& fieldset’: { top: 0 }, }} />

Read more comments on GitHub >

github_iconTop Results From Across the Web

MUI - Outlined select label is not rendering properly
Solution 1: Use TextField. This is what TextField is for. It uses FormControl and InputLabel internally and make sure they work well ...
Read more >
Select API - Material UI - MUI
Name Type Default autoWidth bool false children node classes object
Read more >
Text Field - MudBlazor - Blazor Component Library
Text field components are used for receiving user provided information. ... MudInput a building block of MudTextField without label or helper text.
Read more >
What Really Happens When You Use the TextField ... - Medium
If you are not familiar with Material-UI, it is a React UI framework ... <TextField id="text-field" label="Text Field" variant="outlined" />.
Read more >
v-text-field API - Vuetify
name type default #append‑icon string undefined #append‑outer‑icon string undefined #autofocus boolean false
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