-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(tag): add title to tags #6112
fix(tag): add title to tags #6112
Conversation
Deploy preview for carbon-elements ready! Built with commit daf9563 |
Deploy preview for carbon-components-react ready! Built with commit daf9563 https://deploy-preview-6112--carbon-components-react.netlify.app |
7f71f66
to
7b94886
Compare
@tw15egan would we want to set the |
@joshblack doesn't make much of a difference to me, figured it would be best to opt into this feature than to make it default |
I'm not sure if there are additional a11y reasons for only setting the |
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.
LGTM basically, assuming that we have a condition where doesn't want the title hover. Thanks @tw15egan!
f7a073b
to
c813780
Compare
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.
does there need to be a prop for enabling the title? it should just automatically take the prop value right?
@emyarod do we want it always to be enabled with no way to remove it? I was just following convention like what we do with |
for multiselect I believe that prop is originally from a few years ago and more recently we have been setting titles unconditionally (https://github.com/carbon-design-system/carbon/pull/5621/files #5102). but I think the context for those components is slightly different from tags what I meant in my earlier comment (#6112 (comment)) was I think it makes more sense for the title logic to be identical (or similar) regardless of whether or not it is a filter tag. but if it makes sense to conditionally set the title only for non-filter tags then the new prop is fine |
I'm good with that, I'll just set it by default and remove the prop |
814f479
to
cb9e264
Compare
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.
431e3dd
to
b741227
Compare
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.
looks good to me
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.
🎉
Closes #6111
The
title
attribute onTag
allows the user to customize to text that appears on thearia-label
for the close icon. This PR adds a boolean prop,enableTagTitle
, that when enabled takes the value of the tag and will display it on hover.Changelog
New
enableTagTitle
prop to allow for atitle
attribute to be added on theTag
Changed
title
now is added to the close icon, if provided. Previously was only being added as an aria-label, which due to the naming seems confusing.Tag
storyTesting / Reviewing
Enable/disable the new prop, ensure it works properly