diff --git a/src/lib/input/autosize.ts b/src/lib/input/autosize.ts index 256f4c691e8..6c2fd14f695 100644 --- a/src/lib/input/autosize.ts +++ b/src/lib/input/autosize.ts @@ -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', diff --git a/src/lib/input/input.scss b/src/lib/input/input.scss index 480be0d5e37..38fdfd02435 100644 --- a/src/lib/input/input.scss +++ b/src/lib/input/input.scss @@ -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; +}