Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 52ca5e5

Browse files
calebeggThomasBurleson
authored andcommitted
fix(textarea): Start at a height of one line
Change min-height for textarea to one line height (and remove extra padding space), and set rows=“1”, since it defaults to 2. Closes #2953. Fixes #2154.
1 parent 59c7335 commit 52ca5e5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/components/input/input.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {
247247
element.on('keydown input', onChangeTextarea);
248248
element.on('scroll', onScroll);
249249
angular.element($window).on('resize', onChangeTextarea);
250+
element.attr('rows', '1');
250251

251252
scope.$on('$destroy', function() {
252253
angular.element($window).off('resize', onChangeTextarea);

src/components/input/input.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ md-input-container {
6969
}
7070

7171
textarea.md-input {
72-
min-height: 2 * $input-line-height + $input-border-width-focused + $input-padding-top;
72+
min-height: $input-line-height;
7373
-ms-flex-preferred-size: auto; //IE fix
7474
}
7575

0 commit comments

Comments
 (0)