-
Notifications
You must be signed in to change notification settings - Fork 639
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
Element tooltip when label is too long #14502
Conversation
Adds tooltips to element labels when the label overflows the container.
@gcamacho079 can you take this for a spin before I un-draft it? |
This is awesome! What I was specifically looking for was:
I also tested this with the Zoom accessibility feature on Mac, and it’s working great! 👍🏼 A couple things:
|
@gcamacho079 just pushed some changes to address those issues:
|
@brianjhanson thank you! Just pulled this down again; when I tested this time I seem to be causing the tooltip to close on hover, depending on how quickly/slowly I move my mouse. |
@brianjhanson Maybe worth addressing #14514 with this as well? |
b3310f2
to
6958061
Compare
6958061
to
cf1123e
Compare
@gcamacho079 I think I've resolved the hover issue. Due to the way the markup was, there was a tiny bit of space between the trigger and target. I refactored things a bit so that space is taken up with padding instead of margin, which should maintain the hover state. @brandonkelly I updated table columns to have a max-width of |
@brianjhanson fantastic! The hover experience is excellent. |
[ci skip]
Adds two new web components,
craft-element-label
andcraft-tooltip
.craft-element-label
now wraps all element labels and will calculate if the label overflows its container or not. When it does, acraft-tooltip
will be rendered within the.label-link
using theinnerText
of the element and shown when the user hovers or focuses on the.label-link
. This means component requires a.label-link
to be placed inside it to work, which looks to be true in all our cases.Example
craft-tooltip
is a more generic component that can eventually be used for any tooltips. It basically wraps Floating UI to handle positioning and rendering an arrow with some intelligence.Example
These are both light DOM components, so styling is handled by regular 'ol CSS.
CleanShot.2024-02-29.at.13.15.54-converted.mp4