Skip to content

Commit 7cff349

Browse files
mmalerbatinayuangao
authored andcommitted
fix(input): baseline alignment on textarea (#3714)
* fix(input): baseline alignment on textarea * add mdTextareaAutosize to baseline demo
1 parent cb85eeb commit 7cff349

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/demo-app/baseline/baseline-demo.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
<md-radio-button value="option_3">Radio 3</md-radio-button>
1212
| Text 4 |
1313
<md-input-container>
14-
<input mdInput placeholder="Input">
14+
<input mdInput placeholder="Input" value="Text Input">
15+
</md-input-container>
16+
| Text 5 |
17+
<md-input-container>
18+
<textarea mdInput placeholder="Input" mdTextareaAutosize>Textarea&#10;Line 2</textarea>
1519
</md-input-container>
1620
| Text After
1721
</md-card-content>
@@ -31,7 +35,11 @@ <h1>
3135
<md-radio-button value="option_3">Radio 3</md-radio-button>
3236
| Text 4 |
3337
<md-input-container>
34-
<input mdInput placeholder="Input">
38+
<input mdInput placeholder="Input" value="Text Input">
39+
</md-input-container>
40+
| Text 5 |
41+
<md-input-container>
42+
<textarea mdInput placeholder="Input" mdTextareaAutosize>Textarea&#10;Line 2</textarea>
3543
</md-input-container>
3644
| Text After
3745
</h1>

src/lib/input/input-container.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ $mat-input-underline-disabled-background-image:
8484
padding: 0;
8585
width: 100%;
8686

87+
// Needed to make last line of the textarea line up with the baseline.
88+
vertical-align: bottom;
89+
8790
.mat-end & {
8891
text-align: right;
8992

0 commit comments

Comments
 (0)