{"action":"created","issue":{"url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/21","labels_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/21/comments","events_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/21/events","html_url":"https://github.com/crysalead-js/dom-layer/issues/21","id":77910341,"number":21,"title":"A tricky issue","user":{"login":"justmeandtaken","id":10112825,"avatar_url":"https://avatars.githubusercontent.com/u/10112825?v=3","gravatar_id":"","url":"https://api.github.com/users/justmeandtaken","html_url":"https://github.com/justmeandtaken","followers_url":"https://api.github.com/users/justmeandtaken/followers","following_url":"https://api.github.com/users/justmeandtaken/following{/other_user}","gists_url":"https://api.github.com/users/justmeandtaken/gists{/gist_id}","starred_url":"https://api.github.com/users/justmeandtaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justmeandtaken/subscriptions","organizations_url":"https://api.github.com/users/justmeandtaken/orgs","repos_url":"https://api.github.com/users/justmeandtaken/repos","events_url":"https://api.github.com/users/justmeandtaken/events{/privacy}","received_events_url":"https://api.github.com/users/justmeandtaken/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-05-19T03:20:04Z","updated_at":"2015-05-20T14:43:49Z","closed_at":"2015-05-19T21:25:36Z","body":"This one is a tricky issue..\r\nAs in REACT some attributes need to be set as an property, so there should be an whitelist on this in case people set an attribute and it has to be an property.\r\n\r\nAnyway. The issue is if you set example **checked** as an attribute - it should be an property. So say we now set this as an property, and still in your code this attribute - now property - will be unset as an attribute.\r\n\r\nLook here:  https://github.com/crysalead-js/dom-layer/blob/master/dist/dom-layer.js#L58-L61\r\n\r\nSo even if this now are set as an property, it can be removed as an attribute and it will. And then something will go stright to h...\r\n\r\nI checked how REACT, Mithril, CitoJS and others solve this issue, and you can take a look at CitoJS as it's a raw copy & paste of Mithril on this point:   https://github.com/joelrich/citojs/blob/master/dist/cito.js#L629-L633\r\n\r\nYou see what is done? The attributes that has to be set as an property, are set to not be removed as an attribute. Same does REACT.\r\n\r\nYou also see the issue here with **class** and **className** ?  The first one can be set as an attribute, and the last one both as an attribute and className. But in your code, React and others className should only be an property.\r\n\r\nMeaning. You need to zero out node.className also when you remove the **class** attribute. Else it can be an conflict.\r\n\r\nThis is all about avoiding conflicts. So what you need to do, is to avoid attributes set as property to be removed as an attribute. And vice versa.\r\n\r\nThis is also taken care of in Virtual DOM as you pointed to earlier.\r\n\r\nAnd if you look into the *setter* part of the attributes in CitoJS - also copied from Mithril - you will see that this attributes are forced to be set as an property, just as in REACT as you pointed out to me earlier:\r\n\r\nhttps://github.com/joelrich/citojs/blob/master/dist/cito.js#L608-L612\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/comments/103910780","html_url":"https://github.com/crysalead-js/dom-layer/issues/21#issuecomment-103910780","issue_url":"https://api.github.com/repos/crysalead-js/dom-layer/issues/21","id":103910780,"user":{"login":"jails","id":1306941,"avatar_url":"https://avatars.githubusercontent.com/u/1306941?v=3","gravatar_id":"","url":"https://api.github.com/users/jails","html_url":"https://github.com/jails","followers_url":"https://api.github.com/users/jails/followers","following_url":"https://api.github.com/users/jails/following{/other_user}","gists_url":"https://api.github.com/users/jails/gists{/gist_id}","starred_url":"https://api.github.com/users/jails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jails/subscriptions","organizations_url":"https://api.github.com/users/jails/orgs","repos_url":"https://api.github.com/users/jails/repos","events_url":"https://api.github.com/users/jails/events{/privacy}","received_events_url":"https://api.github.com/users/jails/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T14:43:49Z","updated_at":"2015-05-20T14:43:49Z","body":"maybe `patch`."}}