halfzebra / elm-aframe

:sunglasses: A-Frame bindings for Elm
http://package.elm-lang.org/packages/halfzebra/elm-aframe/latest
29 stars 12 forks source link

Updating DOM is not working #6

Closed tilmans closed 7 years ago

tilmans commented 7 years ago

Maybe this is a known limitation: https://github.com/tilmans/elm-aframe/tree/update_error_example

I have create an Elm App which uses the Logo example to render the elm logo. In addition it has a cursor which will trigger an onClick event. If one of the blue triangles is "clicked" by looking at it the color of the triangle is supposed to turn to red.

In the browser this is not working, the DOM update fails at applyAttrs in applyFacts (hot-update.js). The patch has the correct value changes (color:"#ff0000") but the domNode is "undefined".

halfzebra commented 7 years ago

@tilmans sorry it took me so long to get to this issue.

It is a known issue, and it is caused by the way how A-Frame reacts to changes in the DOM.

Unfortunately, I can't tell if it is possible to have stateful Elm Apps with A-Frame.

I will look in to this during the next month.

tilmans commented 7 years ago

Thanks, if I find the time I'll try to take a look as well. If you have any pointers to good places to start digging please let me know.

tilmans commented 7 years ago

Fixed with 0.4.0 of aframe. 🎉

halfzebra commented 7 years ago

@tilmans great news! 👍