Skip to content

Commit 1f65c42

Browse files
authored
Merge pull request evyros#7 from astronati/master
Replaced watch on input changes with a watch on model changes
2 parents c01f4f9 + dc48045 commit 1f65c42

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

angularjs-autogrow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
$scope.lineHeight = ($element[0].scrollHeight / $scope.attrs.rows) - ($scope.offset / $scope.attrs.rows);
6161
$scope.maxAllowedHeight = ($scope.lineHeight * $scope.attrs.maxLines) - $scope.offset;
6262

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

6565
/**
6666
* Auto-resize when there's content on page load
@@ -71,4 +71,4 @@
7171
}
7272
}
7373
}]);
74-
})();
74+
})();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-autogrow",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "AngularJS 1.x directive for auto-grow / auto-resize of textarea elements",
55
"main": "angularjs-autogrow.js",
66
"scripts": {

0 commit comments

Comments
 (0)