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

Commit

Permalink
fix(textarea): Start at a height of one line
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
calebegg authored and ThomasBurleson committed Jul 1, 2015
1 parent 59c7335 commit 52ca5e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {
element.on('keydown input', onChangeTextarea);
element.on('scroll', onScroll);
angular.element($window).on('resize', onChangeTextarea);
element.attr('rows', '1');

scope.$on('$destroy', function() {
angular.element($window).off('resize', onChangeTextarea);
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ md-input-container {
}

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

Expand Down

0 comments on commit 52ca5e5

Please sign in to comment.