garyb / purescript-virtual-dom

Low level virtual-dom bindings for PureScript
MIT License
30 stars 7 forks source link

Class attribute is impossible #11

Open alexchandel opened 9 years ago

alexchandel commented 9 years ago

Both this:

vnode "nav.nav-bar" {} []

this:

vnode "nav" {class: "nav-bar"} []

and this:

vnode "nav" {"class": "nav-bar"} []

fail to create a nav tag with a class attribute, leaving a tag called nav.nav-bar, no attributes, and no attributes respectively.

Unless I'm missing something, this is a gaping hole in the API.

paf31 commented 9 years ago

Does className work?

alexchandel commented 9 years ago

className seems to work for classes. This ought to be documented in the readme.

garyb commented 9 years ago

That's just the normal name for the class attribute when using the DOM API. The first case nav.nav-bar not working is definitely a bug though.