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

Commit fbd7d9d

Browse files
crisbetoThomasBurleson
authored andcommitted
fix(textarea): take scroll distance into account when setting the height
The textarea resize handle wasn't taking into account the scroll distance, causing it to be off if the page was scrolled. Fixes #8632. Closes #8643
1 parent c66c00f commit fbd7d9d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/components/input/input.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,18 +366,13 @@ function inputTextareaDirective($mdUtil, $window, $mdAria, $timeout, $mdGesture)
366366
});
367367
}
368368

369-
//ngModelCtrl.$setTouched();
370-
//if( ngModelCtrl.$invalid ) containerCtrl.setInvalid();
371-
372369
scope.$on('$destroy', function() {
373370
containerCtrl.setFocused(false);
374371
containerCtrl.setHasValue(false);
375372
containerCtrl.input = null;
376373
});
377374

378-
/**
379-
*
380-
*/
375+
/** Gets run through ngModel's pipeline and set the `has-value` class on the container. */
381376
function ngModelPipelineCheckValue(arg) {
382377
containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));
383378
return arg;
@@ -556,7 +551,7 @@ function inputTextareaDirective($mdUtil, $window, $mdAria, $timeout, $mdGesture)
556551

557552
function onDrag(ev) {
558553
if (!isDragging) return;
559-
element.css('height', startHeight + (ev.pointer.y - dragStart) + 'px');
554+
element.css('height', startHeight + (ev.pointer.y - dragStart) - $mdUtil.scrollTop() + 'px');
560555
}
561556

562557
function onDragEnd(ev) {

0 commit comments

Comments
 (0)