Skip to content

fix(select): update icon color and use correct focused class #30342

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

Merged
merged 18 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(select): use correct focus class for styling
  • Loading branch information
thetaPC committed Apr 4, 2025
commit 42f16cf478e2d59c28377b0a755bf2c058d0ec8b
2 changes: 1 addition & 1 deletion core/src/components/select/select.md.outline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* If the select has a validity state, the
* border should reflect that as a color.
*/
:host(.has-focus.select-fill-outline.ion-valid),
:host(.ion-focused.select-fill-outline.ion-valid),
:host(.select-fill-outline.ion-touched.ion-invalid) {
--border-color: var(--highlight-color);
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/components/select/select.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
color: var(--highlight-color);
}

:host(.has-focus.select-label-placement-floating.ion-valid) .label-text-wrapper,
:host(.ion-focused.select-label-placement-floating.ion-valid) .label-text-wrapper,
:host(.select-label-placement-floating.ion-touched.ion-invalid) .label-text-wrapper,
:host(.has-focus.select-label-placement-stacked.ion-valid) .label-text-wrapper,
:host(.ion-focused.select-label-placement-stacked.ion-valid) .label-text-wrapper,
:host(.select-label-placement-stacked.ion-touched.ion-invalid) .label-text-wrapper {
color: var(--highlight-color);
}
Expand Down Expand Up @@ -93,7 +93,7 @@
* color if there is a validation state.
*/
:host(.select-expanded) .select-wrapper .select-icon,
:host(.has-focus.ion-valid) .select-wrapper .select-icon,
:host(.ion-focused.ion-valid) .select-wrapper .select-icon,
:host(.ion-touched.ion-invalid) .select-wrapper .select-icon,
:host(.ion-focused) .select-wrapper .select-icon {
color: var(--highlight-color);
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/select/select.md.solid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* If the select has a validity state, the
* border should reflect that as a color.
*/
:host(.has-focus.select-fill-solid.ion-valid),
:host(.ion-focused.select-fill-solid.ion-valid),
:host(.select-fill-solid.ion-touched.ion-invalid) {
--border-color: var(--highlight-color);
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ button {
* The component highlight is only shown
* on focus, so we can safely set the valid
* color state when touched/valid. If we
* set it when .has-focus is present then
* set it when .ion-focused is present then
* the highlight color would change
* from the valid color to the component's
* color during the transition after the
Expand Down Expand Up @@ -307,7 +307,7 @@ button {
* is currently focused. Do not show the valid
* highlight when the select is blurred.
*/
:host(.has-focus.ion-valid),
:host(.ion-focused.ion-valid),
:host(.ion-touched.ion-invalid) {
--border-color: var(--highlight-color);
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/components/select/test/a11y/select.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ configs({ directions: ['ltr'], palettes: ['light', 'dark'] }).forEach(({ title,
await page.setContent(
`
<main>
<ion-select class="has-focus" label="Label" value="a">
<ion-select class="ion-focused" label="Label" value="a">
<ion-select-option value="a">Apple</ion-select-option>
</ion-select>
<ion-select class="has-focus" label-placement="floating" label="Label" value="a">
<ion-select class="ion-focused" label-placement="floating" label="Label" value="a">
<ion-select-option value="a">Apple</ion-select-option>
</ion-select>
<ion-select class="has-focus" fill="outline" label-placement="floating" label="Label" value="a">
<ion-select class="ion-focused" fill="outline" label-placement="floating" label="Label" value="a">
<ion-select-option value="a">Apple</ion-select-option>
</ion-select>
</main>
Expand Down