Skip to content

Container can accept a callback #810

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: v-tooltip-3
Choose a base branch
from

Conversation

Rigidoont
Copy link

Right now it’s not possible to specify container for a tooltip in the Shadow DOM. The solution is to accept a callback in the container option in order to resolve the element/selector dynamically right before appending the popper node. This pull request should resolve #346 for the next branch.

@Rigidoont Rigidoont mentioned this pull request Dec 20, 2021
@JRonde
Copy link

JRonde commented Sep 13, 2023

I need to use floating-vue in the Shadow DOM. If this branch provides Shadow DOM support, can it be reviewed and merged?

@Durss
Copy link

Durss commented Mar 17, 2025

It would be very nice for this PR to be accepted
There's still an issue to date to make the tooltip properly work within shadow DOM.

Currently only options are:

  • container:false => but depending on the dom tree this can generates unwanted reflows and tooltip's size gets restricted by its parent's
  • container:body => styles won't get applied properly as they resides within the shadow DOM and thus not available on global scope where the tooltip is mounted

If I'm not mistaken we're supposed to be able to pass in a direct ref to a DOM element but tooltip won't mount if giving an element inside the shadow root, and classes v-popper--some-open and v-popper--some-open--tooltip still get applied to parent body instead of shadow root's (not sure this PR solves this though)

My bad giving a dom ref actually works, I had another issue that led me to a wrong conclusion. But classes stil get applied to parent's body, not sure it's a big deal tho.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Shadow DOM
3 participants