Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
dom names diffing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxenko committed Jan 30, 2017
1 parent d6a5bea commit 77897d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,14 @@ var _diffProps = function (a, b, patches) {
if (a.el && a.el.attributes.length !== aattrs.length) {
for (i = 0; i < a.el.attributes.length; i++) {
var attr = a.el.attributes[i];
var name = attr.name;

if (!(attr.name in aattrs)) {
a.props[attr.name] = attr.value;
if (name === 'class') {
name = 'className';
}

if (!(name in aattrs)) {
a.props[name] = attr.value;
}
}
aattrs = Object.keys(a.props);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "basic-virtual-dom",
"version": "0.2.1",
"version": "0.2.2",
"description": "Basic virtual dom implementation",
"main": "index.js",
"files": [
Expand Down

0 comments on commit 77897d7

Please sign in to comment.