fix(input): support floating labels with slotted content - #31309
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
I renamed these screenshots from input-slots to input-slot to match the folder name.
|
|
||
| configs().forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('input: start and end slots (visual checks)'), () => { | ||
| test.describe(title('input: slot'), () => { |
There was a problem hiding this comment.
This was updated to match the folder name, following how we title other tests.
There was a problem hiding this comment.
This is the correct height and label position for Material Design filled inputs. See: https://m2.material.io/components/text-fields
There was a problem hiding this comment.
This 1px shift was caused by the removal of this rule:
ionic-framework/core/src/components/input/input.scss
Lines 562 to 569 in 048788f
However, this is actually more aligned than before:
There was a problem hiding this comment.
This 1px shift was caused by the removal of this rule:
ionic-framework/core/src/components/input/input.scss
Lines 562 to 569 in 048788f
There was a problem hiding this comment.
This 1px shift was caused by the removal of this rule:
ionic-framework/core/src/components/input/input.scss
Lines 562 to 569 in 048788f
There was a problem hiding this comment.
This 1px shift was caused by the removal of this rule:
ionic-framework/core/src/components/input/input.scss
Lines 562 to 569 in 048788f
ShaneK
left a comment
There was a problem hiding this comment.
Looking really great! I just have two remaining suggested changes, one if you want to defer then that's also acceptable
thetaPC
left a comment
There was a problem hiding this comment.
LGTM, minor things but not blockers

Issue number: resolves #29449 resolves #28665
What is the current behavior?
Inputs with a floating label and a start or end slot always display the label in the floated state, regardless of whether the input contains a value:
What is the new behavior?
mdspecification.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.
Added:
.input-start.input-control.input-endRestructured:
.label-text-wrappermoved from.input-wrapperinto.input-control.native-wrappermoved from.input-wrapperinto.input-control.native-wrapperinto.input-start.native-wrapperinto.input-end.native-wrapperinto.input-end.input-controlnow contains the label text and nativeinput, while start/end content is separated into dedicated wrappersUpdate your selectors to account for these structural changes:
Other information
Preview