Skip to content

Commit

Permalink
Merge pull request #27 from claydiffrient/master
Browse files Browse the repository at this point in the history
[added] Ability to specify style for the modal contents
  • Loading branch information
mzabriskie committed May 8, 2015
2 parents 0b2028e + f5fe537 commit 1829f43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ var ModalPortal = module.exports = React.createClass({
},
div({
ref: "content",
style: this.props.style,
className: cx(this.buildClassName('content'), this.props.className),
tabIndex: "-1",
onClick: stopPropagation,
Expand Down
5 changes: 5 additions & 0 deletions specs/Modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ describe('Modal', function () {
unmountModal();
});

it('supports adding style to the modal contents', function () {
var modal = renderModal({isOpen: true, style: {width: '20px'}});
equal(modal.portal.refs.content.getDOMNode().style.width, '20px');
});

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

0 comments on commit 1829f43

Please sign in to comment.