fix(ui): prevent textarea description overlapping fields and not honoring rows attribute #12406
+22
−6
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.
What?
This PR fixes a few issues with the
textarea
field. Namely, it fixes an issue where the field description would bleed into and overlap subsequent fields, as well as fixing therows
attribute not being honored despite being set in config. It also makes the field more accessible by trigging focus of the textarea when the the field label is clicked, which was not happening previously.Why?
To prevent the field description from overlapping subsequent fields, honor the rows attribute while preserving
field-sizing
and better accessibility when clicking on the field label.How?
htmlFor
attribute.field-sizing
property and therows
attribute are, currently, incompatible with each other as well as height. So, we use CSS variables and some math to compute the min-height to emulate rows instead. The formula is as follows:numRows * lineHeight + padding(y-axis) + borderWidth(y-axis)
implemented ascalc(var(--rows) * base(1) + base(0.8) + 2px)
.FieldLabel
component with anhtmlFor
attribute the same as itsid
.Fixes #12393
Before:

After:
Creating---Post---Payload.webm
The following config was used in the demo above: