Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outlined textfield border label cutoff when centering a div #21664

Closed
2 tasks done
Codetalker777 opened this issue Jul 3, 2020 · 4 comments 路 Fixed by #21665
Closed
2 tasks done

Outlined textfield border label cutoff when centering a div #21664

Codetalker777 opened this issue Jul 3, 2020 · 4 comments 路 Fixed by #21665
Labels
bug 馃悰 Something doesn't work component: text field This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@Codetalker777
Copy link
Contributor

Codetalker777 commented Jul 3, 2020

When

  • 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 馃槸

The outlined text field has a gap in the middle of the text field with the border over the word

Expected Behavior 馃

The outlined text field border should have a gap in the border where the text is at the top

Steps to Reproduce 馃暪

Steps:

  1. https://codesandbox.io/s/strange-golick-1tqqw?file=/src/Demo.js

Context 馃敠

Your Environment 馃寧

Tech Version

| Material-UI | v4.11.0 |
| React | 16.13.1 |
| Browser | Chrome |
| TypeScript | 3.9.5 |
| etc. | |

localhost_3000_Phones - Google Chrome 2020-07-03 4_54_01 PM (2)

@Codetalker777 Codetalker777 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 3, 2020
@oliviertassinari oliviertassinari added component: text field This is the name of the generic UI component, not the React module! bug 馃悰 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 3, 2020
@oliviertassinari
Copy link
Member

@Codetalker777 Thanks for raising and the reproduction. What do you think of this fix?

diff --git a/packages/material-ui/src/OutlinedInput/NotchedOutline.js b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
index 638a936f2..4f0279d91 100644
--- a/packages/material-ui/src/OutlinedInput/NotchedOutline.js
+++ b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
@@ -9,6 +9,7 @@ export const styles = theme => {
   return {
     /* Styles applied to the root element. */
     root: {
+      textAlign: 'left',
       position: 'absolute',
       bottom: 0,
       right: 0,
@@ -24,7 +25,6 @@ export const styles = theme => {
     },
     /* Styles applied to the legend element when `labelWidth` is provided. */
     legend: {
-      textAlign: 'left',
       padding: 0,
       lineHeight: '11px', // sync with `height` in `legend` styles
       transition: theme.transitions.create('width', {
@@ -36,7 +36,6 @@ export const styles = theme => {
     legendLabelled: {
       display: 'block',
       width: 'auto',
-      textAlign: 'left',
       padding: 0,
       height: 11, // sync with `lineHeight` in `legend` styles
       fontSize: '0.75em',

Do you want to work on a pull request? :)

@Codetalker777
Copy link
Contributor Author

Sure I can handle this PR :)

@Codetalker777
Copy link
Contributor Author

@Codetalker777 Thanks for raising and the reproduction. What do you think of this fix?

diff --git a/packages/material-ui/src/OutlinedInput/NotchedOutline.js b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
index 638a936f2..4f0279d91 100644
--- a/packages/material-ui/src/OutlinedInput/NotchedOutline.js
+++ b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
@@ -9,6 +9,7 @@ export const styles = theme => {
   return {
     /* Styles applied to the root element. */
     root: {
+      textAlign: 'left',
       position: 'absolute',
       bottom: 0,
       right: 0,
@@ -24,7 +25,6 @@ export const styles = theme => {
     },
     /* Styles applied to the legend element when `labelWidth` is provided. */
     legend: {
-      textAlign: 'left',
       padding: 0,
       lineHeight: '11px', // sync with `height` in `legend` styles
       transition: theme.transitions.create('width', {
@@ -36,7 +36,6 @@ export const styles = theme => {
     legendLabelled: {
       display: 'block',
       width: 'auto',
-      textAlign: 'left',
       padding: 0,
       height: 11, // sync with `lineHeight` in `legend` styles
       fontSize: '0.75em',

Do you want to work on a pull request? :)

Looks like good fix to me!

@Codetalker777
Copy link
Contributor Author

pull request #21665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something doesn't work component: text field This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants