Skip to content
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

Problem with rendering content inside an SVG tag #11190

Closed
wolandec opened this issue Mar 8, 2020 · 2 comments
Closed

Problem with rendering content inside an SVG tag #11190

wolandec opened this issue Mar 8, 2020 · 2 comments

Comments

@wolandec
Copy link

wolandec commented Mar 8, 2020

Version

2.6.11

Reproduction link

https://codesandbox.io/s/prod-violet-4f5be

Steps to reproduce

Just use a link to minimal reproduction.

What is expected?

"Text from Second.vue" to be appear.

What is actually happening?

"Text from Second.vue" doesn't appear.


In this https://codesandbox.io/s/jovial-violet-qbok9 example I create SVG dynamically with no Vue use and the text "Hello" appears.

Even more weird content: if I add anything in body tag using Chrome devtools, then text shows up.
https://www.youtube.com/watch?v=TxL5olpWqT4

@posva
Copy link
Member

posva commented Mar 8, 2020

div is not allowed inside of an svg. I'm not sure why you see them appearing when editing the HTML but that seems to be a browser bug. If you write a div inside of an svg:

<svg
      width="200"
      height="200"
      xmlns="http://www.w3.org/2000/svg"
      version="1.1"
      xmlns:xlink="http://www.w3.org/1999/xlink"
    >
      <div>Hello from html</div>
    </svg>

in plain html, you will see the div content is not visible even if it is in the DOM

@posva posva closed this as completed Mar 8, 2020
@wolandec
Copy link
Author

wolandec commented Mar 8, 2020

Ok, that is right and I know it, but actually this case began here LinusBorg/portal-vue#290 . So after all, content ported from svg into ordinarry DOM element, and doesn't show up either. Why?

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

No branches or pull requests

2 participants