Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(text field): Long multiline text field - scrolled up on input #20255

Open
kissds opened this issue Aug 10, 2020 · 1 comment · May be fixed by #30312
Open

bug(text field): Long multiline text field - scrolled up on input #20255

kissds opened this issue Aug 10, 2020 · 1 comment · May be fixed by #30312
Labels
area: cdk/text-field help wanted The team would appreciate a PR from the community to address this issue P4 A relatively minor issue that is not relevant to core functions

Comments

@kissds
Copy link

kissds commented Aug 10, 2020

Reproduction

https://monosnap.com/file/mKU40IcGQvhrgnhN9U3TLpAeouTj2g

Steps to reproduce:

  1. open https://v9.material.angular.io/cdk/text-field/examples in ie11
  2. find example "Auto-resizing textarea"
  3. inspect text field in the bottom of page
  4. uncheck element.style max-height (or you can try to reproduce it without cdkAutosizeMaxRows)
  5. insert very long text into the text field (about 50 lines) - height of content must to be higher than viewport's height
  6. put the cursor on the third line from the end (not on last line)
  7. enter some letter

Expected Behavior

The cursor and the letter just entered remain in the viewport.

Actual Behavior

The scroll moved up to the top of textarea

Environment

  • Angular: 9.1.0
  • CDK/Material: 9.2.4 and 10.0.0
  • Browser(s): ie11
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@kissds kissds added the needs triage This issue needs to be triaged by the team label Aug 10, 2020
@jelbourn jelbourn added area: cdk/text-field help wanted The team would appreciate a PR from the community to address this issue P4 A relatively minor issue that is not relevant to core functions and removed needs triage This issue needs to be triaged by the team labels Aug 13, 2020
@mistrykaran91
Copy link

Hi! Is anybody working on it? Otherwise, I could try to fix it if you don't mind.

mistrykaran91 added a commit to mistrykaran91/components that referenced this issue Jan 13, 2025
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 use `blur` and `focus` in `scrollToCaretPosition` method

Fixes angular#20255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/text-field help wanted The team would appreciate a PR from the community to address this issue P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants