Skip to content

Commit 0d2a419

Browse files
crisbetommalerba
authored andcommitted
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.
1 parent 97b1269 commit 0d2a419

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/lib/input/autosize.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {Platform} from '@angular/cdk/platform';
1717
selector: `textarea[mat-autosize], textarea[matTextareaAutosize]`,
1818
exportAs: 'matTextareaAutosize',
1919
host: {
20+
'class': 'mat-autosize',
2021
// Textarea elements that have the directive applied should have a single row by default.
2122
// Browsers normally show two rows by default and therefore this limits the minRows binding.
2223
'rows': '1',

src/lib/input/input.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,9 @@ textarea.mat-input-element {
8282
resize: vertical;
8383
overflow: auto;
8484
}
85+
86+
// Remove the resize handle on autosizing textareas, because whatever height
87+
// the user resized to will be overwritten once they start typing again.
88+
textarea.mat-autosize {
89+
resize: none;
90+
}

0 commit comments

Comments
 (0)