Multiple mat-icon or mat-icon-button as prefix or suffix are displayed in columns
See original GitHub issueBug:
More than one mat-icon or mat-icon-button as prefix or suffix in a mat-form-field are displayed in columns when appearance is other than ‘legacy’.
What is the expected behavior?
They should display in row like in ‘legacy’ appearance.
What is the current behavior?
They are displayed in column.
What are the steps to reproduce?
https://stackblitz.com/edit/material-multiple-presuffix
What is the use-case or motivation for changing an existing behavior?
Behavior is not consistent accros mat-form-field appearances.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@angular/material 7.1.0
All browsers.
Is there anything else we should know?
I see 2 solutions : Solution 1 : Remove this two rules :
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-prefix .mat-icon,
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-suffix .mat-icon {
display: block;
}
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-prefix .mat-icon-button,
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-suffix .mat-icon-button {
display: block;
}
Solution 2 : Use flexbox for prefix and suffix :
.mat-form-field-prefix,
.mat-form-field-suffix {
display: inline-flex;
align-items: center;
}
Potentially related issues : #11650, #13094, #13322 & #13592
Issue Analytics
- State:
- Created 5 years ago
- Reactions:21
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Angular Material: Weird suffix fucntionality - Stack Overflow
I am using angular material's form field component to create my forms... I noticed that if I use a button inside the mat...
Read more >Form field with prefix & suffix - StackBlitz
Form field with prefix & suffix. ... <button mat-icon-button matSuffix (click). ="hide = !hide" [attr.aria-label]="'Hide.
Read more >Angular Material: table - Rob Ferguson
A sample (column definitions) JSON configuration file: ... *matHeaderCellDef class="header-cell-id"> <button mat-icon-button> <mat-icon ...
Read more >Angular Material (MAT) Form-Field - Javatpoint
The <mat-form-field> is a component that is used to wrap multiple MAT components and implement common text field styles of the form-field such...
Read more >Changelog - Oblique
button: ensure links without href are displayed correctly (fbf8cd0) ... material: ensures Oblique style for mat-icon-button only applies to Oblique buttons ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
as a workaround for this, use a single matSuffix div and arrange the items inside however you like: https://stackblitz.com/edit/material-multiple-presuffix-u7kax5?file=app%2Fform-field-prefix-suffix-example.html
Hi! in newest versions of material angular use this: