From 0d2a419a55d9ab63b58cb6b709e1640446ca80d3 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Fri, 8 Dec 2017 18:50:14 +0100 Subject: [PATCH] fix(autosize): remove resize handle (#8621) Removes the resize handle on autosize textareas, because the user's height will be overwritten once they start typing again. --- src/lib/input/autosize.ts | 1 + src/lib/input/input.scss | 6 ++++++ 2 files changed, 7 insertions(+) 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; +}