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

Iframe not resizing properly after switching to jsx-adapter #34

Closed
MrAvantiC opened this issue Jan 31, 2019 · 3 comments
Closed

Iframe not resizing properly after switching to jsx-adapter #34

MrAvantiC opened this issue Jan 31, 2019 · 3 comments

Comments

@MrAvantiC
Copy link

Hey Dennis!

Describe the bug
I wanted to switch from the default template uiengine.html to a template using the jsx-adapter.
While this seemed to work at first, I noticed that after switching the iFrame of the variant-previews does not resize properly anymore.
For some reasons this only happens in Chrome and Safari. In Firefox it still works as expected.

To Reproduce
I have a minimal example repo here:
https://github.com/MrAvantiC/uiengine-jsx-template-demo

The relevant commit is this one:
https://github.com/MrAvantiC/uiengine-jsx-template-demo/commit/60af39f3d8ae7d7693d4c36ea05a032f7edc0302

Any idea what could cause this to happen?

@dennisreimann
Copy link
Owner

The missing <!DOCTYPE html> declaration seems to be the problem. I verified this by adding an HTML template just like the JSX one, but including the doctype.

At first glance I did not find a solution for rendering the doctype tag with JSX. There has been prior discussion about this and it does not seem supported – at least not for this case.

What's your motivation for using a JSX template? I'm using the HTML one in all projects and didn't have a need for something fancier, nevertheless I'm curious :)

@MrAvantiC
Copy link
Author

MrAvantiC commented Feb 5, 2019

Hey,

the reason I was trying this was because - as you might have noticed in #29 - I was trying to get Styled-Components to work with UIEngine.
Now that it did work, I was contemplating on how to handle global styles and thought I'd try the way that the library offered to inject global styling.
Unfortunately that requires JSX and therefore causes the resizing error.

Since there does not seem to be an easy way to inject the doctype into the html it does not seem worth it though, so back to HTML/CSS I guess. ;)

Thanks for your help!

@dennisreimann
Copy link
Owner

Thanks for elaborating on that! Get back any time you encounter trouble or things that aren't clear, this is valuable feedback :)

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