fix(textarea): support floating labels with slotted content - #31321
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brandyscarney
commented
Aug 3, 2026
| <slot name="start"></slot> | ||
| </div> | ||
| {hasOutlineFill && <div class="textarea-outline-container">{this.renderOutlineDecorations()}</div>} | ||
| <div class="textarea-start"> |
Member
Author
There was a problem hiding this comment.
I renamed the slot wrapper divs from the following:
start-slot-wrapper→textarea-startend-slot-wrapper→textarea-end
The goal was to align the naming with the wrapper elements added to Input.
This also matches our existing naming pattern with elements like input-bottom and textarea-bottom.
brandyscarney
commented
Aug 3, 2026
Member
Author
There was a problem hiding this comment.
I renamed these screenshots from textarea-slots to textarea-slot to match the folder name.
brandyscarney
commented
Aug 3, 2026
|
|
||
| configs().forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('textarea: start and end slots (visual checks)'), () => { | ||
| test.describe(title('textarea: slot'), () => { |
Member
Author
There was a problem hiding this comment.
This was updated to match the folder name, following how we title other tests.
ShaneK
approved these changes
Aug 13, 2026
thetaPC
approved these changes
Aug 14, 2026
thetaPC
left a comment
Contributor
There was a problem hiding this comment.
LGTM, just minor docs: .textarea-wrapper-inner is still mentioned in docs/shadow-parts-guidelines.md.
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.
Issue number: N/A
What is the current behavior?
Textareas with a floating label and a start or end slot always display the label in the floated state, regardless of whether the textarea contains a value:
What is the new behavior?
mdspecification.Does this introduce a breaking change?
Floating Label Behavior
Floating labels no longer automatically float when the textarea contains slotted content. Labels float only when the textarea is focused or has a value.
Internal DOM Structure Changes
The internal DOM structure has been reorganized to support floating labels with slotted content.
Removed:
.textarea-wrapper-innerAdded:
.textarea-controlRenamed:
.start-slot-wrapper→.textarea-start.end-slot-wrapper→.textarea-endRestructured:
.label-text-wrappermoved from.textarea-wrapper-innerinto.textarea-control.native-wrappermoved from.textarea-wrapper-innerinto.textarea-control.start-slot-wrappermoved from.textarea-wrapper-innerto.textarea-wrapperand was renamed.textarea-start.end-slot-wrappermoved from.textarea-wrapper-innerto.textarea-wrapperand was renamed.textarea-endUpdate your selectors to account for these structural changes:
Minimum Height Change
The minimum height of textarea in Material Design (
mdmode) is now72px. At the default number of rows this makes textareas the same height regardless of thefillproperty orlabelPlacement. Previously the minimum height was:start,end,fixed44pxfloating,stacked56pxsolid,outline56pxThese were minimums, not the heights textareas actually rendered at. A textarea with content in the
startorendslots was already taller than its minimum, so the change affects it differently. For example, afill="solid"textarea with slotted icons and buttons previously rendered at72pxwith astartlabel and81pxwith afloatinglabel. Both are now72px, so that floating label case is9pxshorter than before rather than taller.Because
72pxis taller than two rows of text,rowsvalues below3no longer change the height of the textarea inmdmode:rows="1"androws="2"both render at72px.If you were relying on the previous heights, or you need
rowsto control the height, override the minimum height back. The override has to be more specific than the component's own style, so a bareion-textareaselector will not apply. Add a custom class to the textarea to increase specificity:Other information
Preview