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

Commit

Permalink
fix(input): fix hidden textarea height issue
Browse files Browse the repository at this point in the history
Closes #1356.
  • Loading branch information
Robert Messerle committed Feb 19, 2015
1 parent eda14e9 commit efbd414
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,14 @@ function inputTextareaDirective($mdUtil, $window) {

function growTextarea() {
node.style.height = "auto";
var line = node.scrollHeight - node.offsetHeight;
node.scrollTop = 0;
var height = node.offsetHeight + (line > 0 ? line : 0);
node.style.height = height + 'px';
var height = getHeight();
if (height) node.style.height = height + 'px';
}

function getHeight () {
var line = node.scrollHeight - node.offsetHeight;
return node.offsetHeight + (line > 0 ? line : 0);
}

function onScroll(e) {
Expand Down

0 comments on commit efbd414

Please sign in to comment.