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

[svg] foreignObject's contents are invisible #278

Closed
amio opened this issue Aug 20, 2016 · 6 comments
Closed

[svg] foreignObject's contents are invisible #278

amio opened this issue Aug 20, 2016 · 6 comments
Milestone

Comments

@amio
Copy link

amio commented Aug 20, 2016

I couldn't figure out why but here is the example code:
https://esnextb.in/?gist=8983fe352fb6664e7f13716af7a12744

the same svg code works in a plain html:
https://jsfiddle.net/leaverou/qwg3r/

More infomation:

  • Adding attribute style="background-color: yellow" to <foreignObject /> has correct effect
  • Adding attribute style="background-color: yellow" to foreignObject's children has no effect
@amio amio changed the title [svg] foreignObject is invisible [svg] foreignObject's contents are invisible Aug 20, 2016
@developit
Copy link
Member

@amio Good catch - Preact switches into an SVG mode during rendering, and needs to switch back out of that mode when encountering <foreignObject>. We can use this issue to track fixing that oversight.

@developit developit added this to the 5.8 milestone Aug 20, 2016
developit added a commit that referenced this issue Aug 20, 2016
@developit
Copy link
Member

Waiting on a couple more things in order to release this, but it looks like the fix works!

@amio
Copy link
Author

amio commented Aug 21, 2016

Lightning fast! 👍 😄

@developit
Copy link
Member

Thanks! Hoping to get this released shortly.

@johnrees
Copy link

Just ran into this issue whilst using the latest preact-cli. Was a fix added?

@developit
Copy link
Member

developit commented Jan 24, 2018

it's been fixed for a while!

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

No branches or pull requests

3 participants