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

Maintain scroll position while a textarea is resized #20

Open
wants to merge 1 commit into
base: refactor
Choose a base branch
from

Conversation

koddsson
Copy link
Contributor

@koddsson koddsson commented Nov 2, 2021

If a textarea is positioned near the end of a page, we can get in a situation where we set the height of the textarea to auto before setting the correct height. This causes the page to shrink which effectively scrolls the page up for the user. When the textarea then expands, the user is not scrolled back down to the textarea. The user experiences this change as a scroll up movement which is unexpected for them.

This pull request makes the library aware of the user scroll position and makes sure to set the scroll position to what it was before the resizing after the resizing is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants