Repository navigation
Fix auto-height textarea collapsing to 2px when shown - #59
Merged
skartknet merged 1 commit intoOct 14, 2026
Merged
Conversation
uui-textarea measures its auto height when connected. If the property is hidden with display: none at that point it collapses to ~2px and never re-measures. Re-run autoUpdateHeight() on any auto-height textareas when a hidden property or group is shown again. Fixes skartknet#58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #58
What
A textarea set to auto height that starts out hidden by a Conditional Displayer now appears at the right height when it's shown, instead of collapsing to about 2px.
Why
uui-textareameasures its auto height once, when it's added to the page. If the property isdisplay: noneat that point, it measures as 0 and sets its height to2px. WhentoggleElementslater removesdisplay: none, nothing measures it again.How
In
toggleElements, when an element that was hidden is shown again,refreshAutoHeightTextareasfinds anyuui-textarea[auto-height]inside it and calls the textarea's ownautoUpdateHeight()on the next animation frame, once it's visible.display: none. Tabs don't need it, because only the tab button is hidden and a tab's content is rendered when you open it.Testing
Tested on the TestWebV17 site (Umbraco 17.4): a CD Dropdown switches from a media picker to a textarea that was hidden on load.
The textarea's measured height went from
2pxbefore the fix to104pxafter (all five lines visible).