Skip to content

Commit

Permalink
fix(input): baseline alignment on textarea (#3714)
Browse files Browse the repository at this point in the history
* fix(input): baseline alignment on textarea

* add mdTextareaAutosize to baseline demo
  • Loading branch information
mmalerba authored and tinayuangao committed Mar 27, 2017
1 parent cb85eeb commit 7cff349
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/demo-app/baseline/baseline-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
<md-radio-button value="option_3">Radio 3</md-radio-button>
| Text 4 |
<md-input-container>
<input mdInput placeholder="Input">
<input mdInput placeholder="Input" value="Text Input">
</md-input-container>
| Text 5 |
<md-input-container>
<textarea mdInput placeholder="Input" mdTextareaAutosize>Textarea&#10;Line 2</textarea>
</md-input-container>
| Text After
</md-card-content>
Expand All @@ -31,7 +35,11 @@ <h1>
<md-radio-button value="option_3">Radio 3</md-radio-button>
| Text 4 |
<md-input-container>
<input mdInput placeholder="Input">
<input mdInput placeholder="Input" value="Text Input">
</md-input-container>
| Text 5 |
<md-input-container>
<textarea mdInput placeholder="Input" mdTextareaAutosize>Textarea&#10;Line 2</textarea>
</md-input-container>
| Text After
</h1>
Expand Down
3 changes: 3 additions & 0 deletions src/lib/input/input-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ $mat-input-underline-disabled-background-image:
padding: 0;
width: 100%;

// Needed to make last line of the textarea line up with the baseline.
vertical-align: bottom;

.mat-end & {
text-align: right;

Expand Down

0 comments on commit 7cff349

Please sign in to comment.