fix(input): support floating labels with slotted content - #31309
fix(input): support floating labels with slotted content#31309brandyscarney wants to merge 21 commits into
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

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?
Internal DOM Structure Changes
New wrapper elements have been added to the component's internal DOM structure to support floating labels with slotted start and end content. Additionally, the structure of the component has been reorganized, with some elements now grouped differently than before. This may introduce breaking changes for developers who rely on the component's internal DOM structure or apply custom styling to internal elements.
The following internal wrapper elements have been added:
<div class="input-start">wrapper for the start slot<div class="input-control">wrapper for the label and native control<div class="input-end">wrapper for the end slot and clear buttonWhile the public API has not changed, selectors or style overrides targeting the previous markup may need to be updated to reference the new wrapper elements and their organization. If you have custom CSS targeting the internal structure of input, update your selectors to account for these structural changes.
Other information
Preview