-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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(label): keep color when focused on a floating or stacked label #18576
fix(label): keep color when focused on a floating or stacked label #18576
Conversation
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.
Thank you for the PR! Unfortunately this will remove the default behavior of changing the label to primary on focus. The fix for this is likely updating the following to check for :not(.ion-color)
on the label:
:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked),
:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating) {
color: $label-md-text-color-focused;
}
:host-context(.item-has-focus).label-stacked,
:host-context(.item-has-focus).label-floating {
color: $label-md-text-color-focused;
}
I have updated the code but don't you think this request might have unexpected effects for people who were counting on primary color always being used for focused items? |
@topalavlad No this looks good! I think this is the correct CSS for the label, and expected behavior. The only issue seems to be that the highlight color for the bottom of the item is still using primary. I'm thinking we need to pass the label color up somehow. |
Thanks so much for this PR! 😊 Sorry it took so long to get in. |
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
When a stacked label with
color
attribute set is focused, it switches color to primary (only on MD)Issue Number: #18531
What is the new behavior?
A stacked label with
color
attribute set will keep its color when focusedDoes this introduce a breaking change?