Skip to content

Lazy don't work like it should #27

@ghivert

Description

@ghivert

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions