{"action":"created","issue":{"url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/176","labels_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/176/comments","events_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/176/events","html_url":"https://github.com/Matt-Esch/virtual-dom/issues/176","id":55113413,"number":176,"title":"diff and patching nodes with contentEditable='inherit'","user":{"login":"RGBboy","id":1566539,"avatar_url":"https://avatars.githubusercontent.com/u/1566539?v=3","gravatar_id":"","url":"https://api.github.com/users/RGBboy","html_url":"https://github.com/RGBboy","followers_url":"https://api.github.com/users/RGBboy/followers","following_url":"https://api.github.com/users/RGBboy/following{/other_user}","gists_url":"https://api.github.com/users/RGBboy/gists{/gist_id}","starred_url":"https://api.github.com/users/RGBboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RGBboy/subscriptions","organizations_url":"https://api.github.com/users/RGBboy/orgs","repos_url":"https://api.github.com/users/RGBboy/repos","events_url":"https://api.github.com/users/RGBboy/events{/privacy}","received_events_url":"https://api.github.com/users/RGBboy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-01-22T04:31:05Z","updated_at":"2015-06-21T11:36:43Z","closed_at":null,"body":"If the contentEditable property is not specified on a node to update and the existing node has it, virtual-dom tries to set it to a blank string. This throws the following error in Chrome and Firefox:\r\n\r\n```\r\nUncaught SyntaxError: Failed to set the 'contentEditable' property on 'HTMLElement': The value provided ('') is not one of 'true', 'false', 'plaintext-only', or 'inherit'.\r\n```\r\n\r\nHere is my setup that produces the error:\r\n\r\n``` html\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n  <head>\r\n    <script src=\"script.js\"></script>\r\n  </head>\r\n  <body>\r\n    <div id=\"App\"></div>\r\n  </body>\r\n</html>\r\n```\r\n\r\n``` javascript\r\nvar h = require('virtual-dom/h'),\r\n    diff = require('virtual-dom/diff'),\r\n    patch = require('virtual-dom/patch'),\r\n    createElement = require('virtual-dom/create-element'),\r\n    virtualize = require('vdom-virtualize'),\r\n    document = global.document,\r\n    element = document.getElementById('App'),\r\n    tree = virtualize(element),\r\n    newTree = h('div'),\r\n    patches = diff(tree, newTree);\r\n\r\nelement = patch(element, patches);\r\n```\r\n\r\nI also put together a requirebin to show the problem: http://requirebin.com/?gist=d96693e487580d462d4f\r\n\r\nWhen vdom-virtualize creates the tree it finds the contentEditable property is set to `inherit`. Then when the new tree is created contentEditable is not specified so a patch is created to remove it. This then causes the error because contentEditable must be set to one of `true`, `false`, `plaintext-only`, or `inherit`. `inherit` is the default value.\r\n\r\nThere are a couple of solutions to this. Either when a node is created, if contentEditable is undefined it is set to `inherit` or when nodes are diffed if one node has contentEditable set to `inherit` and the other undefined then the diff is nothing."},"comment":{"url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/comments/113886851","html_url":"https://github.com/Matt-Esch/virtual-dom/issues/176#issuecomment-113886851","issue_url":"https://api.github.com/repos/Matt-Esch/virtual-dom/issues/176","id":113886851,"user":{"login":"bitinn","id":1484279,"avatar_url":"https://avatars.githubusercontent.com/u/1484279?v=3","gravatar_id":"","url":"https://api.github.com/users/bitinn","html_url":"https://github.com/bitinn","followers_url":"https://api.github.com/users/bitinn/followers","following_url":"https://api.github.com/users/bitinn/following{/other_user}","gists_url":"https://api.github.com/users/bitinn/gists{/gist_id}","starred_url":"https://api.github.com/users/bitinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitinn/subscriptions","organizations_url":"https://api.github.com/users/bitinn/orgs","repos_url":"https://api.github.com/users/bitinn/repos","events_url":"https://api.github.com/users/bitinn/events{/privacy}","received_events_url":"https://api.github.com/users/bitinn/received_events","type":"User","site_admin":false},"created_at":"2015-06-21T11:36:43Z","updated_at":"2015-06-21T11:36:43Z","body":"Both vdom-virtualize and vdom-parser should have workarounds this problem, how did you run into it?\n\n? 2015?6?21??19:11?Adam Avramov <notifications@github.com<mailto:notifications@github.com>> ???\n\n\n+1 for this issue. What shall we do about it?\n\n-\nReply to this email directly or view it on GitHub<https://github.com/Matt-Esch/virtual-dom/issues/176#issuecomment-113885494>.\n"}}