mui / mui/material-ui

OutlinedInput without label has break in outline due to legend in fieldset

Open Beginner friendly
#37,216 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

has workaround scope: text field type: bug
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Steps to reproduce 🕹

https://codesandbox.io/s/sad-fermi-o14mu1?file=/src/App.tsx

Basically create a TextField (variant outlined) or OutlinedInput without label and zoom in (better visible when focused)

Current behavior 😯

image
Visible break in outlined due to legend

Expected behavior 🤔

image
No label => No legend => No break in outline

Context 🔦

I upgraded from MUI v4. MUI v4 did not have this issue as the legend had a fixed width of 0.01px set.

Your environment 🌎
npx @mui/envinfo
  System:
    OS: Linux 6.1 Arch Linux
  Binaries:
    Node: 19.9.0 - /usr/bin/node
    Yarn: Not Found
    npm: 8.19.2 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 112.0.2 <-- used

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and inspect the outlined TextField and OutlinedInput behavior without a label. Compare the current result with the noted MUI v4 legend width, then verify that focused and zoomed controls have a continuous outline without a visible break.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.