Skip to content

Commit 63d4359

Browse files
mmalerbakara
authored andcommitted
fix(input): make icons in prefix/suffix the right size (#3342)
1 parent be167c9 commit 63d4359

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/demo-app/input/input-demo.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,8 @@ <h4>Textarea</h4>
206206
Both:
207207
<md-input-container align="end">
208208
<input mdInput #email placeholder="Email Address" value="angular-core">
209-
<span mdPrefix>
210-
<md-icon [class.primary]="email.focused" class="demo-icons demo-transform">email</md-icon>
211-
&nbsp;
212-
</span>
213-
<span mdSuffix class="demo-transform" [class.primary]="email.focused">
214-
&nbsp;@gmail.com
215-
</span>
209+
<span mdPrefix><md-icon [class.primary]="email.focused">email</md-icon>&nbsp;</span>
210+
<span mdSuffix [class.primary]="email.focused">&nbsp;@gmail.com</span>
216211
</md-input-container>
217212
</p>
218213

src/lib/input/input-container.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,16 @@ $mat-input-underline-disabled-background-image:
234234
}
235235
}
236236

237-
// Prevents the prefix and suffix from stretching together with the container.
238237
.mat-input-prefix, .mat-input-suffix {
238+
// Prevents the prefix and suffix from stretching together with the container.
239239
width: 0.1px;
240240
white-space: nowrap;
241+
242+
// Allow icons in a prefix/suffix to adapt to the correct size.
243+
& .mat-icon {
244+
width: auto;
245+
height: auto;
246+
font-size: 100%;
247+
vertical-align: top;
248+
}
241249
}

0 commit comments

Comments
 (0)