-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix(input): support floating labels with slotted content #31309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: major-9.0
Are you sure you want to change the base?
Changes from all commits
71a8fc3
5e98726
7adbc3e
7dddcf7
26c8c13
be85bad
375995b
7c4e480
f8e5be6
106dfea
9ef4d4b
eaeada8
996134f
fd0557a
3072291
1483023
cc20bbf
4ac30a6
892f6e7
921b54e
6c81728
93e14a0
9b59417
3fcf658
4aedde9
85e105a
8b29fe1
7df2591
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| --border-radius: 4px; | ||
| --padding-start: 16px; | ||
| --padding-end: 16px; | ||
| --internal-start-container-adjustment: 0px; | ||
|
|
||
| min-height: 56px; | ||
| } | ||
|
|
@@ -90,7 +91,7 @@ | |
| * This makes the label sit above the input. | ||
| */ | ||
| :host(.label-floating.input-fill-outline) .label-text-wrapper { | ||
| @include transform(translateY(-32%), scale(#{$form-control-label-stacked-scale})); | ||
| @include transform(translate(var(--internal-start-container-adjustment, 0px), -32%), scale(#{$form-control-label-stacked-scale})); | ||
| @include margin(0); | ||
|
|
||
| /** | ||
|
|
@@ -100,16 +101,6 @@ | |
| max-width: calc((100% - var(--padding-start) - var(--padding-end) - #{$input-md-floating-label-padding * 2}) / #{$form-control-label-stacked-scale}); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The percentage now resolves against With no slots the available label width drops from 427px to 384px, which is the 32px of padding over the |
||
| } | ||
|
|
||
| /** | ||
| * This ensures that the input does not | ||
| * overlap the floating label while still | ||
| * remaining visually centered. | ||
| */ | ||
| :host(.input-fill-outline.input-label-placement-stacked) input, | ||
| :host(.input-fill-outline.input-label-placement-floating) input { | ||
| @include margin(6px, 0, 6px, 0); | ||
| } | ||
|
|
||
| // Input Fill: Outline Outline Container | ||
| // ---------------------------------------------------------------- | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This covers the three added wrappers but not what moved out of
.native-wrapper, which is the part anyone with custom CSS needs. The start slot, end slot and clear button all left it, and the label is no longer a direct child of the wrapper, so a selector like.native-wrapper [slot="start"]stops matching.The behavior change is missing too. Floating labels no longer auto-float with a start or end slot present, which also hides the placeholder at rest.
The same text is in the v9 migration guide PR, so both would want the update.