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

Apparent bug on IE11 #2

Closed
mkxml opened this issue Feb 2, 2016 · 6 comments
Closed

Apparent bug on IE11 #2

mkxml opened this issue Feb 2, 2016 · 6 comments
Labels

Comments

@mkxml
Copy link
Contributor

mkxml commented Feb 2, 2016

Hello.

Apparently there is a bug when rendering svgs on IE11. Anyone else can report this?

From my tests I found out that in the defineProperty loop IE11 seems to reject the viewport property.

It appears to be the only property it rejects raising an error. The screenshot below show a hack that just skips that property and then everything works fine including all my preact components and stuff.

screen1

I couldn't reproduce this on MS Edge or on any other modern browsers, I didn't test on IE versions prior to 11 though.

The screenshot below shows the IE11 throwing the error in my code:

screen2

For now I'm using my hack since it does affect my use case. I don't know exactly if viewport is needed here for other people or how else we should tackle this.

@developit
Copy link
Owner

Hi @mkautzmann - great bug report, thank you for the helpful screen captures and context. One additional detail that would help me diagnose would be the value of el.nodeName at the time of the exception. If the issue ocurrs on svg nodes themselves, then it's a more difficult fix. If it's being triggered on any other type of element, I can simply add a conditional similar to yours.

Cheers!

@developit developit added the bug label Feb 2, 2016
@mkxml
Copy link
Contributor Author

mkxml commented Feb 2, 2016

el.nodeName is svg at the exception. I'm rendering other elements with preact in the page but IE blocks the rendering on all elements because of this preact-svg bug. It must be something hardcoded in IE that doesn't accept viewport property definition on svg.

@developit
Copy link
Owner

@mkautzmann Since most browsers are not affected by this, I think the best solution would be to wrap the property assignment in a try/catch. It won't be the best for performance, but it will mean viewport can still be adjusted dynamically in 99% of browsers.

@mkxml
Copy link
Contributor Author

mkxml commented Feb 2, 2016

@developit Looks fine. I can do that and submit a PR if you find that OK. It may stay around as long as IE11 is relevant. Edge does not have the issue.

@developit
Copy link
Owner

That would be awesome, I'll merge and release right away if you have the time.

@developit
Copy link
Owner

Fix released in 1.3.0

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

No branches or pull requests

2 participants