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 setting page height with elm-ui #5

Closed
danmarcab opened this issue Sep 30, 2019 · 7 comments
Closed

Problem setting page height with elm-ui #5

danmarcab opened this issue Sep 30, 2019 · 7 comments

Comments

@danmarcab
Copy link
Contributor

Hi! First of all thank you for making this! I am excited to use it for my personal page.

I've run into an small issue when using elm-pages with elm-ui.
I wanted to make Element.layout take the full height of the page using Element.width Element.fill. This is something I've done many times with elm-ui.

Digging a bit I found elm-pages I found it is wrapping the user provided view with a div here:

[ Html.div
[ Html.Attributes.attribute "data-url" (Url.toString model.url)
]
[ body
|> Html.map UserMsg
]

elm-ui is setting the height to 100%, but having a parent element makes it only taking the content height.

I am not sure what's the best way to proceed or even if it's something you should consider fixing, but I thought it was good to let you know!

Thank you again!

@dillonkearns
Copy link
Owner

Hello @danmarcab, thanks for taking the time to make the issue!

This is definitely something I'm going to fix. I actually realized a few days ago that I should be able to accomplish what I need to with just a simple empty, display: none div that is above the main rendered content, not surrounding it.

In case you're curious and didn't guess it already, the reason for the wrapper div is to allow me to check when the view function has completed and rendered after each url change (there's no other way to know for sure). When the url changes, I register url hover listeners in JS to lazy load when you're about to click a link.

I should have a fix for this shortly!

@danmarcab
Copy link
Contributor Author

That's great @dillonkearns !

Also thank you for the explanation, you are definitely doing some cool stuff here! 👍

@dillonkearns
Copy link
Owner

Hey @danmarcab! So I pushed a fix for this to master. I'll cut a new release soon. Here's the change: 47c1f92

@danmarcab
Copy link
Contributor Author

Great! Thank you!

@dillonkearns
Copy link
Owner

Hello @danmarcab, I've pushed the fix!

Just install the latest NPM package version (1.0.39) and you'll be good to go!

https://github.com/dillonkearns/elm-pages/blob/master/CHANGELOG-NPM.md#1039---2019-10-18

Thanks again for reporting the issue! Let me know if you run into anything else.

@jmjr
Copy link

jmjr commented Nov 19, 2019

Hi @dillonkearns

I have difficulties installing the latest npm package version (because I'm a noob), thus would love to see the fix in the published version which I can install using elm install. Any chance that will happen soon?

Thanks for your great work!

@dillonkearns
Copy link
Owner

@jmjr right now some elm code is copy-pasted by the npm package. So you don’t need to update your elm package version. Just go into your package.json, and change the version of elm-pages to be 1.0.39 and that will take care of it.

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

3 participants