Skip to content

Commit

Permalink
Fixes key creation skipping elements with null keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mairatma committed Aug 31, 2016
1 parent 800a9e1 commit 669af22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/metal-jsx/src/JSXRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class JSXRenderer extends IncrementalDomRenderer {
handleJSXElementOpened_({args}) {
if (childrenCount.length > 0) {
const count = ++childrenCount[childrenCount.length - 1];
if (!core.isDef(args[1])) {
if (!core.isDefAndNotNull(args[1])) {
args[1] = JSXRenderer.KEY_PREFIX + count;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/metal-jsx/test/JSXRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ describe('JSXRenderer', function() {
class TestComponent extends TestJSXComponent {
render() {
return <div>
{!this.props.hide && <div><ChildComponent /></div>}
<div><ChildComponent2 /></div>
{!this.props.hide && <div class="child1"><ChildComponent /></div>}
<div class="child1"><ChildComponent2 /></div>
</div>
}
}
Expand Down

0 comments on commit 669af22

Please sign in to comment.