From 7630498ca1cdf46c3f95be3b3a0589c24b340beb Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Sun, 29 Nov 2015 00:54:28 +0100 Subject: [PATCH] fix(textarea): only compute style on textarea setup --- src/components/input/input.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/input/input.js b/src/components/input/input.js index 8d62ee0203b..fb169ef5518 100644 --- a/src/components/input/input.js +++ b/src/components/input/input.js @@ -296,15 +296,15 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) { element.on('scroll', onScroll); } + // Trigger the input event to compute style + element.triggerHandler('input'); + angular.element($window).on('resize', onChangeTextarea); scope.$on('$destroy', function() { angular.element($window).off('resize', onChangeTextarea); }); - // Trigger the input event to compute style - element.triggerHandler('input'); - function growTextarea() { // sets the md-input-container height to avoid jumping around container.style.height = container.offsetHeight + 'px';