Skip to content
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

fix(select): ensure select sizes are respected when the label is empty #30087

Merged
merged 7 commits into from
Dec 20, 2024
21 changes: 0 additions & 21 deletions core/src/components/select/select.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@
cursor: pointer;
}

/**
* Since the label sits on top of the element,
* the component needs to be taller otherwise the
* label will appear too close to the select text.
*/
:host(.select-label-placement-floating),
:host(.select-label-placement-stacked) {
min-height: 56px;
}

:host(.ion-color) {
--highlight-color-focused: #{current-color(base)};
}
Expand Down Expand Up @@ -221,17 +211,6 @@ button {
overflow: hidden;
}

:host(.select-label-placement-stacked) .select-wrapper-inner,
:host(.select-label-placement-floating) .select-wrapper-inner {
/**
* When using a stacked/floating label, the inner wrapper is
* stacked vertically under the label container. This line
* ensures that the inner wrapper fills all the remaining height
* of the component.
*/
flex-grow: 1;
}

// Select Highlight
// ----------------------------------------------------------------

Expand Down
21 changes: 21 additions & 0 deletions core/src/components/select/select.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,27 @@
max-width: calc(100% / #{$form-control-label-stacked-scale});
}

/**
* Since the label sits on top of the element,
* the component needs to be taller otherwise the
* label will appear too close to the select text.
*/
:host(.select-label-placement-floating),
:host(.select-label-placement-stacked) {
min-height: 56px;
}

/**
* When using a stacked/floating label, the inner wrapper is
* stacked vertically under the label container. This line
* ensures that the inner wrapper fills all the remaining height
* of the component.
*/
:host(.select-label-placement-stacked) .select-wrapper-inner,
:host(.select-label-placement-floating) .select-wrapper-inner {
flex-grow: 1;
}

// Start/End Slots
// ----------------------------------------------------------------

Expand Down
Loading