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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OutlinedInput] normalize.css breaks the notch #19386

Closed
2 tasks done
ardov opened this issue Jan 25, 2020 · 4 comments · Fixed by #19389
Closed
2 tasks done

[OutlinedInput] normalize.css breaks the notch #19386

ardov opened this issue Jan 25, 2020 · 4 comments · Fixed by #19389
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

@ardov
Copy link
Contributor

ardov commented Jan 25, 2020

Normalize.css adds display rule to legend that breaks the notch in OutlinedInput

legend {
  display: table;
}
  • 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 😯

With normalize.css enabled, the notch is always visible.
image

Expected Behavior 🤔

notch is hidden

Steps to Reproduce 🕹

https://codesandbox.io/s/legend-display-bug-g70zr

Context 🔦

Your Environment 🌎

Tech Version
Material-UI v4.9.0
React v16.12
@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. labels Jan 25, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 25, 2020

@Alexeyun1k Thank you for the report. I believe we should be able to handle this problem in the core. Enabling developers to cherry-pick our components in a codebase without any side effects has been a core design value since the beginning.

What do you think of this diff?

diff --git a/packages/material-ui/src/OutlinedInput/NotchedOutline.js b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
index 374f86068..4e85fb12f 100644
--- a/packages/material-ui/src/OutlinedInput/NotchedOutline.js
+++ b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
@@ -34,6 +34,7 @@ export const styles = theme => {
     },
     /* Styles applied to the legend element. */
     legendLabelled: {
+      display: 'block',
       textAlign: 'left',
       padding: 0,
       height: 11, // sync with `lineHeight` in `legend` styles

@ardov
Copy link
Contributor Author

ardov commented Jan 25, 2020

Cool, that should fix it 👍

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 25, 2020

@Alexeyun1k Great, feel free to submit a pull request :). We haven't anticipated popular global CSS resets.

@ardov
Copy link
Contributor Author

ardov commented Jan 25, 2020

Ok, I'll do it :)

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