Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Fix Textarea autosize calculation in special case #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rkg-mm
Copy link
Owner

@rkg-mm rkg-mm commented Apr 28, 2017

In some cases the textarea's autosize method was called before the textarea had proper bounds applied. In this case a clone of the textarea was created without a width set and the width was also not updated later. This lead to a wrong calculation of textarea height, because the clone used for calculation had a very small width, while the real textarea could be much bigger, which produced a lot of whitespace the longer the text got.

This fix delays the creation of the clone until the bounds are available. Fixed the issue in our project.

rstmm added 3 commits April 28, 2017 13:41
In some cases the textarea's autosize method was called before the textarea had proper bounds applied. In this case a clone of the textarea was created without a width set and the width was also not updated later. This lead to a wrong calculation of textarea height, because the clone used for calculation had a very small width, while the real textarea could be much bigger, which produced a lot of whitespace the longer the text got.

This fix delays the creation of the clone until the bounds are available. Fixed the issue in our project.
Initial fix reverted (caused problems and did not fully solve the problem) and using another approach now, which also covers resizing browser window.
Initial fix reverted (caused problems and did not fully solve the problem) and using another approach now, which also covers resizing browser window. (sorry last commit was based on wrong file version)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants