Skip to content

Commit

Permalink
[added] Supporting custom overlay className
Browse files Browse the repository at this point in the history
closes reactjs#14
  • Loading branch information
mzabriskie committed Nov 17, 2014
1 parent b15aa82 commit 28dbc63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ var ModalPortal = module.exports = React.createClass({
render: function() {
return this.shouldBeClosed() ? div() : (
div({
className: this.buildClassName('overlay'),
ref: "overlay",
className: cx(this.buildClassName('overlay'), this.props.overlayClassName),
style: this.overlayStyles,
onClick: this.handleOverlayClick
},
Expand Down
6 changes: 6 additions & 0 deletions specs/Modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ describe('Modal', function () {
unmountModal();
});

it('supports overlayClassName', function () {
var modal = renderModal({isOpen: true, overlayClassName: 'myOverlayClass'});
equal(modal.portal.refs.overlay.getDOMNode().className.contains('myOverlayClass'), true);
unmountModal();
});

it('adds --after-open for animations', function() {
var modal = renderModal({isOpen: true});
var overlay = document.querySelector('.ReactModal__Overlay');
Expand Down

0 comments on commit 28dbc63

Please sign in to comment.