Skip to content

Commit

Permalink
fix(autosize): remove resize handle (#8621)
Browse files Browse the repository at this point in the history
Removes the resize handle on autosize textareas, because the user's height will be overwritten once they start typing again.
  • Loading branch information
crisbeto authored and mmalerba committed Dec 8, 2017
1 parent d7db066 commit 28452ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/input/autosize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {Platform} from '@angular/cdk/platform';
selector: `textarea[mat-autosize], textarea[matTextareaAutosize]`,
exportAs: 'matTextareaAutosize',
host: {
'class': 'mat-autosize',
// Textarea elements that have the directive applied should have a single row by default.
// Browsers normally show two rows by default and therefore this limits the minRows binding.
'rows': '1',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ textarea.mat-input-element {
resize: vertical;
overflow: auto;
}

// Remove the resize handle on autosizing textareas, because whatever height
// the user resized to will be overwritten once they start typing again.
textarea.mat-autosize {
resize: none;
}

0 comments on commit 28452ab

Please sign in to comment.