Skip to content

How to add tooltip for dropdown button? #1961

Answered by claviska
mato-a asked this question in Help
Discussion options

You must be logged in to vote

Tooltips currently have to wrap their target element, and slotted elements have to be a direct descendent of their host element.

In short, wrap the button with a tooltip and move the slot attribute from the button to the tooltip. There's one other catch, though. Tooltips use display: contents by default so their position can't be measured as usual. To fix that, apply style="display: inline-block" as shown in this example.

https://codepen.io/claviska/pen/PogRyGO?editors=1100

I hope that helps!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mato-a
Comment options

@claviska
Comment options

Answer selected by mato-a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants