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

Lazy don't work like it should #27

Open
ghivert opened this issue Jan 29, 2020 · 3 comments
Open

Lazy don't work like it should #27

ghivert opened this issue Jan 29, 2020 · 3 comments

Comments

@ghivert
Copy link
Contributor

ghivert commented Jan 29, 2020

The lazy function doesn't work like it should. Today it adds a div between the function body and the parent container.

Let's take an example.

-- Counter.elm

module Counter exposing (..)

import BodyBuilder as B
import BodyBuilder.Attributes as A

myView : Int -> B.NodeWithStyle msg
myView counter = 
  B.div [ A.id "first-div" ]
    [ B.lazy myCounter counter ]
  
myCounter : Int -> B.NodeWithStyle msg
myCounter counter =
  B.div [ A.id "second-div" ]
    [ B.text counter ]

This results in:

<div id="first-div">
  <div style="height: 100%; overflow: scroll;"> <!-- This div should be stylizable on its own. -->
    <div id="second-div">
      counter
    </div>
  </div>
</div>
@tibastral
Copy link
Contributor

tibastral commented Jan 29, 2020 via email

@ghivert
Copy link
Contributor Author

ghivert commented Jan 31, 2020

Shouldn't we be using inherit for every important property? Instead of anything else, just get the properties from parent and use them in the div to make the div transparent?

@tibastral
Copy link
Contributor

tibastral commented Jan 31, 2020 via email

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