-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[TextField] conflicts with Bootstrap #19463
Comments
The problem appears not only with bootstrap. |
Please, make a example in codesandbox too |
|
This can be fixed by adding this to your css: legend { |
replace label to "oooooo" |
This can solve, but with the label in uppercase this doesn't work. This is my case, take a look: |
While this is an important issue to take care of to enable progressive migration from Bootstrap to Material-UI, I'm wondering. What are the use cases for using Material-UI with Bootstrap outside legacy considerations? :) |
We are developing a system with a deadline we cant go back and refact our code. The material part (Textfield and Grid) is minor than bootstrap (system grid)(and we have a lot of forms). I guess i will refactor input component to imitation of materialUI textfield haha |
@cadrimiranda in this context, you can either revert to the previous release of Material-UI until we release a patch, wait for a patch, or go ahead with proposing a pull request to patch that we will release later this week. However, it doesn't answer the question regarding the motivation for using both :). |
@oliviertassinari this can answer:
In addition, in the initial phase of the project, we only used the bootstrap and the user interface / UX design left the organization and come another with the idea of using Material Design and he proposed a new design. We liked it a lot and we are now using. |
@homyden I'm facing the same issue with normilize.css. |
Thanks @homyden to find another use cases. Tonight i guess i'll fork the repository and try to fix this ... |
You are welcome! =) In version 4.8.3, textfield had a bug related to the label in the outline variant. If you use texfield in tabs for example. It has been fixed in this commit. And then changed transitions. So, need to find out how another css libraries affect these changes Sorry for my broken English =) |
It's a duplicate of #19386.
It was fixed in #19389.
@grant-davidson has shared a solution. So I would suggest the following: diff --git a/packages/material-ui/src/OutlinedInput/NotchedOutline.js b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
index 9a339d0c9..1b474382d 100644
--- a/packages/material-ui/src/OutlinedInput/NotchedOutline.js
+++ b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
@@ -34,7 +34,8 @@ export const styles = theme => {
},
/* Styles applied to the legend element. */
legendLabelled: {
- display: 'block',
+ display: 'block', // Fix conflict with normalize.css and sanitize.css
+ width: 'auto', // Fix conflict with bootstrap
textAlign: 'left',
padding: 0,
height: 11, // sync with `lineHeight` in `legend` styles @cadrimiranda Do you want to submit a pull request? :) |
@oliviertassinari i'll, thanks. |
in bootstrap 5, doing this worked legend {
float: unset;
} let me know if it works for you |
@adrijshikhar Do you see it displayed like this with Bootstrap v5? |
Yes |
@adrijshikhar Ok, no objection to fix it in the diff --git a/packages/material-ui/src/OutlinedInput/NotchedOutline.js b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
index c690dedc37..50d2ee71d1 100644
--- a/packages/material-ui/src/OutlinedInput/NotchedOutline.js
+++ b/packages/material-ui/src/OutlinedInput/NotchedOutline.js
@@ -20,6 +20,7 @@ const NotchedOutlineRoot = experimentalStyled('fieldset')({
});
const NotchedOutlineLegend = experimentalStyled('legend')(({ styleProps, theme }) => ({
+ float: 'unset', // Fix conflict with bootstrap
...(styleProps.label === undefined && {
padding: 0,
lineHeight: '11px', // sync with `height` in `legend` styles
@@ -29,8 +30,8 @@ const NotchedOutlineLegend = experimentalStyled('legend')(({ styleProps, theme }
}),
}),
...(styleProps.label !== undefined && {
- display: 'block',
- width: 'auto',
+ display: 'block', // Fix conflict with normalize.css and sanitize.css
+ width: 'auto', // Fix conflict with bootstrap
padding: 0,
height: 11, // sync with `lineHeight` in `legend` styles
fontSize: '0.75em', |
the problem is same for me too. |
@talentedexpert0057 If you are seeing this issue #19463 (comment) feel free to submit a PR with the fix proposed. |
I am watching this issue in my codebase. how to solve this in my codebase? thank you. |
Hi, I am working on it |
Hi, I am working on this issue. |
Use the following property: |
@homyden the normalize.css screen you showed in #19463 (comment) actually happens with Safari 15 on mui.com |
This has been reported already in #31367 |
Current Behavior 😯
When i use Bootstrap and MaterialUI, the Textfield with outlined variant and label with shrink props enter in conflicts with label style and the input show incorrect width of label inside the fieldset .
Expected Behavior 🤔
I want to use Bootstrap with MaterialUI in my project. In older versions, this does not happen (4.8.3 and under don't happen).
Steps to Reproduce 🕹
https://codesandbox.io/s/winter-meadow-219i9?fontsize=14&hidenavigation=1&theme=dark
Steps:
Context 🔦
My project design uses MaterialUI Components and Bootstrap and at the moment I can't remove the bootstrap or redesign my app to remove Material UI.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: