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

flow left / right cause error on re-render #10

Closed
jcollard opened this Issue Nov 23, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@jcollard
Contributor

jcollard commented Nov 23, 2014

Initially, the page loads fine. however, upon clicking the rerendering only the second number is rerendered correctly. The console gives the following error message: Uncaught TypeError: Cannot read property 'style' of undefined

module Bug where

import Text (asText)
import Graphics.Element (..)
import Signal (Signal, foldp, (<~))
import Mouse

display : (Int, Int) -> Element
display (f, s) = 
    -- No problem with flow down
    --flow down [ asText f, asText s ]

    -- However, it fails with flow right
    flow right [ asText f, asText s ]

-- Each time someone clicks, roll the dice.
handleClick : () -> (Int, Int) -> (Int, Int)
handleClick _ (f, s) = (f + 1, s + 1)

-- Basic wiring
main : Signal Element
main = display <~ (foldp handleClick (0, 0) Mouse.clicks)
@jcollard

This comment has been minimized.

Show comment
Hide comment
@jcollard

jcollard Nov 24, 2014

Contributor

Fixed!

Contributor

jcollard commented Nov 24, 2014

Fixed!

@jcollard jcollard closed this Nov 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment