{"action":"created","issue":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/3796","repository_url":"https://api.github.com/repos/libgdx/libgdx","labels_url":"https://api.github.com/repos/libgdx/libgdx/issues/3796/labels{/name}","comments_url":"https://api.github.com/repos/libgdx/libgdx/issues/3796/comments","events_url":"https://api.github.com/repos/libgdx/libgdx/issues/3796/events","html_url":"https://github.com/libgdx/libgdx/issues/3796","id":129824981,"number":3796,"title":"Textarea in a ScrollPane","user":{"login":"voidburn","id":1438321,"avatar_url":"https://avatars.githubusercontent.com/u/1438321?v=3","gravatar_id":"","url":"https://api.github.com/users/voidburn","html_url":"https://github.com/voidburn","followers_url":"https://api.github.com/users/voidburn/followers","following_url":"https://api.github.com/users/voidburn/following{/other_user}","gists_url":"https://api.github.com/users/voidburn/gists{/gist_id}","starred_url":"https://api.github.com/users/voidburn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voidburn/subscriptions","organizations_url":"https://api.github.com/users/voidburn/orgs","repos_url":"https://api.github.com/users/voidburn/repos","events_url":"https://api.github.com/users/voidburn/events{/privacy}","received_events_url":"https://api.github.com/users/voidburn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libgdx/libgdx/labels/scene2d","name":"scene2d","color":"ff00ff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-29T17:02:49Z","updated_at":"2016-02-21T21:43:13Z","closed_at":null,"body":"This is basically the same problem discussed in #2320, which hasn't been investigated further. I tried to tackle it, and as suggested I found a way (pretty easy) to have the TextArea re-evaluate it's height based on the text. \r\n\r\nThe TextArea pane resized as expected but, as MobiDevelop hinted, something does not work properly, since the ScrollPane where it was nested didn't seem to care about its child changing size, therefore not computing the new child height and updating the scrollbar. I've tried all possible methods that hinted to calling for a re-evaluation of the layout (invalidate, invalidateHierarchy, layout), but nothing made the ScrollPane aware of the TextArea new size.\r\n\r\nI can't find a way to identify the problem, but if fixed, I'd be happy to contribute a mode switching for the TextArea which enables it to either behave as it is now (default) or switch to growing its size along with the contained text height. And perhaps a wordwrap on/off mode, since scrolling will be possible at that stage.\r\n\r\nI've attached a test which only demonstrates how a TextArea currently fails to work compared to using a Label inside a ScrollPane (drop the class in the gdx-tests-lwjgl project sources and run it). \r\n\r\nSteps towards a solution:\r\n\r\n**Step 1** is to make the TextArea resize itself when a new line gets added or removed (I checked the desired size every time the text had to be drawn, but it can easily be done only when needed, such as adding a new character to the text)\r\n\r\n**Step 2** is to figure out why the ScrollPane ignores the new size.\r\n\r\n[ScrollableTextAreaTest.zip](https://github.com/libgdx/libgdx/files/110058/ScrollableTextAreaTest.zip)"},"comment":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/comments/186924394","html_url":"https://github.com/libgdx/libgdx/issues/3796#issuecomment-186924394","issue_url":"https://api.github.com/repos/libgdx/libgdx/issues/3796","id":186924394,"user":{"login":"voidburn","id":1438321,"avatar_url":"https://avatars.githubusercontent.com/u/1438321?v=3","gravatar_id":"","url":"https://api.github.com/users/voidburn","html_url":"https://github.com/voidburn","followers_url":"https://api.github.com/users/voidburn/followers","following_url":"https://api.github.com/users/voidburn/following{/other_user}","gists_url":"https://api.github.com/users/voidburn/gists{/gist_id}","starred_url":"https://api.github.com/users/voidburn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voidburn/subscriptions","organizations_url":"https://api.github.com/users/voidburn/orgs","repos_url":"https://api.github.com/users/voidburn/repos","events_url":"https://api.github.com/users/voidburn/events{/privacy}","received_events_url":"https://api.github.com/users/voidburn/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T21:43:12Z","updated_at":"2016-02-21T21:43:12Z","body":"Cannot try on the spot, I left that idea behind but will try again to embed the scrolling in the future"}}