Skip to content

Commit

Permalink
Merge bba9fa7 into 65ae16e
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Sep 11, 2019
2 parents 65ae16e + bba9fa7 commit d69ddba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/diff/props.js
Expand Up @@ -31,7 +31,7 @@ function setStyle(style, key, value) {
style.setProperty(key, value);
}
else {
style[key] = typeof value==='number' && IS_NON_DIMENSIONAL.test(key)===false ? value+'px' : value || '';
style[key] = typeof value==='number' && IS_NON_DIMENSIONAL.test(key)===false ? value+'px' : value==null ? '' : value;
}
}

Expand Down
14 changes: 14 additions & 0 deletions test/browser/render.test.js
Expand Up @@ -422,6 +422,20 @@ describe('render()', () => {
}
});

it('should support opacity 0', () => {
render(<div style={{ opacity: 1 }}>Test</div>, scratch);
let style = scratch.firstChild.style;
expect(style)
.to.have.property('opacity')
.that.equals('1');

render(<div style={{ opacity: 0 }}>Test</div>, scratch);
style = scratch.firstChild.style;
expect(style)
.to.have.property('opacity')
.that.equals('0');
});

it('should replace previous style objects', () => {
render(<div style={{ display: 'inline' }}>test</div>, scratch);

Expand Down

0 comments on commit d69ddba

Please sign in to comment.