[Textfield] Border lines of Textfield cross over the text label shrinked by MuiInputLabel
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react, typescript
Research direction
Start by running the linked CodeSandbox reproduction with the theme-level MuiInputLabel shrink setting and compare it with the per-TextField InputLabelProps case. Trace the TextField and MuiInputLabel entry points to identify the differing behavior. Done means the outlined border no longer crosses a label that is shrunk through the theme, with the existing per-component case still working.
Written by the indexing model from the issue text.
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Borders of Textfield component cross over the shrinked text label.

Expected Behavior 🤔
Border lines overlapping with the shrinked text label are hidden.

Steps to Reproduce 🕹
https://codesandbox.io/s/elegant-leakey-zsflw?file=/src/App.tsx
source code
import {
createTheme,
Stack,
TextField,
ThemeProvider
} from "@material-ui/core";
import React from "react";
const theme = createTheme({
components: {
MuiInputLabel: {
defaultProps: { shrink: true }
}
}
});
function App() {
return (
<ThemeProvider theme={theme}>
<Stack sx={{ m: 5 }} spacing={2}>
{/*NG*/}
<TextField label="Abcdefghi" />
{/*OK*/}
<TextField label="Abcdefghi" InputLabelProps={{ shrink: true }} />
</Stack>
</ThemeProvider>
);
}
export default App;
Steps:
shrink: trueis specified intheme.InputLabelProps = {{shrink: true}}is not specified inTextField.
Context 🔦
Your Environment 🌎
`npx @material-ui/envinfo`
my browser: Google Chrome 90.0.4430.212(Official Build)(x86_64)
my pc: macOS Big Sur ver 11.2.2
npx @material-ui/envinfo
System:
OS: Linux 5.4 Debian GNU/Linux 10 (buster) 10 (buster)
Binaries:
Node: 14.17.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.13 - /usr/local/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
@emotion/react: ^11.4.0 => 11.4.0
@emotion/styled: ^11.3.0 => 11.3.0
@material-ui/core: ^5.0.0-alpha.35 => 5.0.0-alpha.35
@material-ui/icons: ^5.0.0-alpha.35 => 5.0.0-alpha.35
@material-ui/private-theming: 5.0.0-alpha.35
@material-ui/styled-engine: 5.0.0-alpha.34
@material-ui/system: 5.0.0-alpha.35
@material-ui/types: 6.0.1
@material-ui/unstyled: 5.0.0-alpha.35
@material-ui/utils: 5.0.0-alpha.35
@types/react: ^17.0.8 => 17.0.9
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: ^4.1.2 => 4.3.2
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mui/material-ui
-
type: new feature waiting for 👍
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mui/material-ui#48254 · 3 comments · 1 reaction ·
-
has workaround scope: avatar waiting for 👍
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mui/material-ui#48190 · 5 comments ·
-
has workaround scope: typography type: new feature waiting for 👍
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
mui/material-ui#46488 · 2 comments · 1 reaction ·
-
has workaround scope: text field type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mui/material-ui#37216 · 6 comments ·
-
docs scope: autocomplete
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
mui/material-ui#35713 · 5 comments ·
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100