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

Initial render renders without styling #14

Closed
ivymarkwell opened this issue Apr 9, 2020 · 3 comments
Closed

Initial render renders without styling #14

ivymarkwell opened this issue Apr 9, 2020 · 3 comments
Labels
good first issue Good for newcomers

Comments

@ivymarkwell
Copy link
Collaborator

ivymarkwell commented Apr 9, 2020

Hello!

I was recently using your tutorial to update my own application of LiveView because I had found this issue #5 you had opened and was having the same problem.

I noticed that the initial render of the application was still rendering without the styling the exact same way and I believe it is because the root layout is defined as a LiveView layout. Reading the documentation, I believe defining the root layout as a LiveView layout is preventing the initial render to include the styling since the LiveView layouts are rendered after (?), the same way as the initial problem (except before they were never being rendered). I've attached a couple of gifs to better illustrate.

Before:
before

After:
after

I fixed this in my own repo by defining the root layout in the router, like:

live "/dashboard", MyApp.Dashboard, layout: {MyApp.LayoutView, :root}

and rendering the root layout as a regular .eex template. I also of course pulled down y'all's repo and verified this also fixes the same problem. Anyways! I know it's a super minute issue, just wanted to point it out and also to clarify my own understanding of why the problem was happening.

Thanks :)

@iteles iteles added the good first issue Good for newcomers label Apr 13, 2020
@iteles
Copy link
Member

iteles commented Apr 13, 2020

@ivymarkwell This is a great catch and thank you for submitting such a detailed issue 😍

If you have a chance, we'd love it if you could submit a PR to fix this issue ☺️

@ivymarkwell
Copy link
Collaborator Author

@iteles Forked the repo and opened #15

@ivymarkwell
Copy link
Collaborator Author

This should be fixed now with #16

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

No branches or pull requests

2 participants