Skip to content

Commit 60af3c5

Browse files
committed
fix(cdk/text-field): Long multiline textfield focus issue.
When we have long multiline textfield and put cursor on almost an end (For eg. on 3rd last line) the scroll moves up to the top of textarea. This fix will set the `scrollTop` `scrollToCaretPosition` method Fixes #20255
1 parent ef62d5c commit 60af3c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cdk/text-field/autosize.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ export class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {
367367
// it to receive focus on IE and Edge.
368368
if (!this._destroyed.isStopped && this._hasFocus) {
369369
textarea.setSelectionRange(selectionStart, selectionEnd);
370+
textarea.scrollTop = textarea.scrollHeight;
370371
}
371372
}
372373
}

0 commit comments

Comments
 (0)