-
Notifications
You must be signed in to change notification settings - Fork 71
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
poppers on SVG elements #60
Comments
Unfortunately for your case, I don't think so since Popper is currently unable to be "renderless" as in not rendering any element except the one that it wraps. I don't know if that's even possible. SVGs can have HTML in them using Thanks for the reproduction, I cloned your repo and it's an interesting problem, I just don't see the solution at the moment. |
@valgeirb thanks for the quick reply! We have used foreignObject but as far as I can tell it requires to fix position and size, which is complicated here. The best would be to place the additional HTML elements outside the SVG. Do you think it would be feasible to create a <template>
<PopperDetached
v-for="(d, name) in districts"
:key="name"
:hover="true"
:trigger="name">
<template #content>
...
</template>
</PopperDetached>
<svg
...
>
<g>
<path
v-for="(d, name) in districts"
:key="name"
:id="name"
...
/>
</g>
</svg>
</template> (based on the non-working code here: https://gitlab.com/simevo/vue3-svg-map/-/blob/vue3-popper/src/components/MapMaharashtra.vue) Notice the |
I have a similar use case that I'd love an implementation for. Any update here? The |
Had a similar issue, and solved it using |
We have a use case where we want to display poppers on SVG elements.
The easiest and leaner solution is to have standard tooltips generated with the
<title>
SVG element, see this proof-of-concept: https://gitlab.com/simevo/vue3-svg-mapCons: you can't control the tooltip etc.
We have successfully integrated bootstrap5 popovers (based on Popper 2), this works well like this:
You just enable them in the
mounted
hook and they work. But of course they are not reactive!vue3-popper looks like the solution to make them reactive. So I have tried using this library in the vue3popper branch of the vue3-svg-map prototype: https://gitlab.com/simevo/vue3-svg-map/-/merge_requests/1
Unfortunately when the
<Popper>
element is expanded, it generates a bunch of HTML tags which are simply ignored in the SVG,therefore the map disappears.:
Is there an easy solution to make vue3-popper work with SVG ?
The text was updated successfully, but these errors were encountered: