dfilatov / vidom

Library to build UI based on virtual DOM
MIT License
415 stars 16 forks source link

boolean attributes missing #47

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi. I can't see how you are handling boolean attributes!

dfilatov commented 9 years ago

Please try at least before create issue.

vidom.mountToDom(
    rootDomNode,
    vidom.createNode('button').attrs({ disabled : true }).children('work'));

It works.

ghost commented 9 years ago

Agree. Disabled are also a property. So how are I'm going to set it as a property? You are only showing me setting it as an attribute. Different boolean attributes!

Take a look here: https://github.com/joelrich/citojs/blob/master/dist/cito.js#L739-L750

Mithril does the same. And Kivi.

dfilatov commented 9 years ago

So how are I'm going to set it as a property

What's a purpose? What do you want to get? It works now and as user you get correct result.

ghost commented 9 years ago

I'm not the developer here. I guess this would be a good read for you: https://github.com/facebook/react/blob/847357e42e5267b04dd6e297219eaa125ab2f9f4/src/browser/ui/dom/HTMLDOMPropertyConfig.js