-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
fix(form-field): remove 200px width since it messes up flex layouts #7083
Conversation
i think that this issue prevent upgrading to new angular material version cause the global look of the input in the application is break(high bug) and the WA for that is too high. |
@ChenReuven you can use a CSS override to put this back how it used to be until this PR makes it in: /* class repeated for increased specificity */
.mat-form-field.mat-form-field {
width: auto;
} |
@mmalerba Thanks Bro! i will try it :) |
seems to have some broken select tests, will investigate |
Note: need to update screenshot tests |
@mmalerba Thanks for the hint. |
@mmalerba the temporary workaround you suggested affects the paginator. conflicts with 56px width in
|
How do I get the changes made in this PR? I'm a bit confused about what it means by " andrewseguin merged commit 160a511 into angular:master". I checked npm for angular 2 material https://www.npmjs.com/package/@angular2-material/input, and the last update was 6 months ago. Edit: I already made the CSS change of
on my project, but it's more of a GitHub question. |
After this change horizontal forms with <div fxLayout="row" fxLayoutGap="10px">
<mat-form-field fxFlex>
<input matInput>
</mat-form-field>
<mat-form-field fxFlex>
<input matInput>
</mat-form-field>
<mat-form-field fxFlex>
<input matInput>
</mat-form-field>
<mat-form-field fxFlex>
<input matInput>
</mat-form-field>
<mat-form-field fxFlex>
<input matInput>
</mat-form-field>
<mat-form-field fxFlex>
<input matInput>
</mat-form-field>
<mat-form-field fxFlex>
<input matInput>
</mat-form-field>
</div> All form fields remain 180px in width due to |
Sorry for taking out this thread. |
We are also experiencing a problem with a fixed width of the mat-form-field-infix class. It is not letting us shrink the mat-select component. |
@vadim82 |
The only thing I was able to do was to override that selector and set the min width to something smaller. It is a terrible solution, but I can't think of any other workaround.
|
Is there a fix for this yet? Without wrapping mat-select components in mat-form-field elements I lose placeholder functionality but wrapping them breaks my bootstrap/flex column widths as described above? |
I don't think there's a way to set these properties that's going to make it work perfectly for everyone out of the box. If you need to change the width just add some CSS: .mat-form-field .mat-form-field-infix {
width: auto;
} You should not need to use |
Maybe I am missing something, but I can't get it to set the width to auto. I have created a Stackblitz for this: |
@Webfield that is because view encapsulation is enabled in the component you added the style to. There are a couple ways to fix it:
Here's a fixed version of your stackblitz using option number 3: https://stackblitz.com/edit/angular-material-whdy24?file=app%2Fapp.component.css |
Thanks you so much! Since the shadow piercings |
Adding this to the global styles made the fxFlex attribute work for me
|
Just Add this , it works for me |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.