Reputation: 10818
I have a mat-form-field with <span>💡</span>
as a matSuffix
<mat-form-field appearance="outline">
<input matInput
placeholder="Details"
name="details"
required />
<span matSuffix>💡</span>
</mat-form-field>
The problem that emigi does not align with a text
Any ideas how to fix?
Upvotes: 7
Views: 12141
Reputation: 936
Just override mat-form-field-infix
and mat-form-field-suffix
class as below
.mat-form-field-infix {
top: 0em !important;
}
.mat-form-field-suffix {
top: 0em !important;
}
Upvotes: 1
Reputation: 141
You can fix it by overriding the material class. i.e. :host /deep/ .mat-form-field-suffix { top: 0; }
Upvotes: 0
Reputation: 17918
Use a DIV and try adjusting the position of the icon to compensate for the discrepancy between the default font size 16px and the size of a standard mat-icon suffix 24px:
<div matSuffix style="position: relative; bottom: 8px;">💡</div>
Upvotes: 9