Skip to content

Commit

Permalink
Merge pull request #7 from astronati/master
Browse files Browse the repository at this point in the history
Replaced watch on input changes with a watch on model changes
  • Loading branch information
evyros committed Jun 25, 2017
2 parents c01f4f9 + dc48045 commit 1f65c42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions angularjs-autogrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$scope.lineHeight = ($element[0].scrollHeight / $scope.attrs.rows) - ($scope.offset / $scope.attrs.rows);
$scope.maxAllowedHeight = ($scope.lineHeight * $scope.attrs.maxLines) - $scope.offset;

$element[0].addEventListener('input', $scope.autogrowFn);
$scope.$watch($attrs.ngModel, $scope.autogrowFn);

/**
* Auto-resize when there's content on page load
Expand All @@ -71,4 +71,4 @@
}
}
}]);
})();
})();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularjs-autogrow",
"version": "0.2.0",
"version": "0.3.0",
"description": "AngularJS 1.x directive for auto-grow / auto-resize of textarea elements",
"main": "angularjs-autogrow.js",
"scripts": {
Expand Down

0 comments on commit 1f65c42

Please sign in to comment.