-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Can't portal content from svg #290
Comments
Edit: this seems to be related: #287 |
Hello! Thank you for your time. I make it simpler and it doesn't work either, so as I see you've mentioned that #287 issue, guess that problem is the same as mine. |
https://codesandbox.io/s/ecstatic-mclaren-u45lb Even more simpler: with no component tag. |
I've got another interesting stuff. If I add anything in body tag using Chrome devtools, then ported content shows up. |
Okay, this is getting weirder by the minute 🧐 Maybe a Chrome bug? Need to test other browsers... |
I've already tested in Firefox. The same result. |
Weird. Just - weird. |
May it be a Vue bug? I remove portal-vue and just leave div inside svg in vue applcation. Div is invisible. Dynamically create the same html with no Vue using. Div is visible. |
Getting this issue as well. Static content in the SVG portaled outside of it works fine. Static content inside a |
It seems that Vue's I can't tell wether this is a browser bug, Vue bug or portal-vue issue, and have no idea how it could be fixed. Will rate this a wontfix caveat. |
Although this issue is already closed, I'd like to add another finding: This code works perfectly fine. It even works if the portal is nested into several
But as soon as I put the portal inside a component, the teleported content exists in the DOM but is not shown anymore.
I suggest it to be a portal-vue or vue issue |
I have the same problem. I am trying to port several things out of an SVG into HTML. The problem is, that the ported element is in the SVG namespace and not HTML namespace. Since div-tags are not SVG elements, it doesn't know how to handle these. This is an issue with portal-vue which has to make sure that the namespace of its members is fixed depending on where the portal is mounted. That means, that porting SVG elements into HTML needs to fix the namespace to HTML EXCEPT for the The hack I tried and worked is: <svg>
...
<Portal to="target">
<svg width="100%" height="100%">
<foreignObject width="100%" height="100%">
...html content
</foreignObject>
</svg>
</Portal>
</svg> |
@LinusBorg it turned out that vue 3 with Teleport can handle that in case the Teleport component is wrapped into a foreignObject-tag. Unfortunately, this does not work in portal-vue. However, if Teleport can do it, Portal should also be able to do it. Do you think this could be fixed? |
I may find some time to look into it but my impression so far is that this would require a change in Vue 2 core. |
https://codesandbox.io/s/strange-keldysh-7pwk1
I expect to window appears, but it's not.
If I move
<component :is="Second"></component>
outside the svg tag, everything is ok then.The text was updated successfully, but these errors were encountered: