23 Replies
i tried z index but that didnt seem to work
its serverbar that hiding it, this is just <Serverbar/>
idk how to fix it though
What triggers the popup ?
a hover
i turned it off rn
So it's more of a tool tip?
i guess
Why not use s pseudo element?
whats that
maybe it's
overflow-y-scroll
??oh that makes it show
how do i handle overflow then
will that ever be an issue?
its supposed to be a scroll thing
like discord server list
so maybe use auto not scroll. when you set overflow in one axis the other axis is set to hidden automatically iirc
it still the same
am i doing the tooltip wrong
you probably need to move it out of this container then just like discord does
oh
how do i chekc if the server button is hovered if its out of the container
ill figure it out thx guys
discord has an element that is outside of the navigation that is getting updated (position text etc) when you hover over one otherwise it's empty
I know you have figured this out but I was already looking the code so here is how I might do this using Tailwind:
A quick demo (with a few alterations and additions) https://codepen.io/cbolson/pen/mdZpXzp
I now realize that your issue is less about the tooltip and more about the vertical scroll. I will take another look...
I suspect that you have resolved this but I have continued to look at it anyway 😅
As Mannix has mentioned, you probably need to take the "tooltip" out of its container and place it on the DOM directly so as to avoid the clipping.
I have made a further test which uses JS to try this out
https://codepen.io/cbolson/pen/LYKedaJ
Note - It could still do with some more JS, such as hiding the tooltip on scroll and possibly also repositioning it so that it is always positioned on the vertical center of the "avatar" when initiating the display animation.
Update - I have refactored the JS so that it generates the tooltip on hover (and then destroys it on mouseout) rather than on load. This ensures that its starting position is always relative to the button, thus avoiding strange transitions when having scrolled the parent container.
Chris Bolson
CodePen
[Demo] - Discord style avatar tooltips
This version uses JS to position the tooltips to allow them to overflow the sidebar overflow limitation required to have vertical scroll....
i think with
anchor
positioning it would be possible? as the elements don't have to be in the same container?
But even if so, it's not supported enough yet for productionI need to take a closer look at
anchor
🤔.
I will admit that I tend to not play around too much with these newer properties until they get acceptable browser support.anchor is 🤯
It solves so many problems so easily. The polyfill for it is also good enough that GitHub is using it on their site currently
I should do a video on it, and give a shoutout to oddbird (Miriam Suzane's company) who made the polyfill
wow sorry i havent replied i wen tto sleep
yea i didnt solve it yet so thank u guys