Skip to content

Commit 1829f43

Browse files
committed
Merge pull request #27 from claydiffrient/master
[added] Ability to specify style for the modal contents
2 parents 0b2028e + f5fe537 commit 1829f43

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/components/ModalPortal.js

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ var ModalPortal = module.exports = React.createClass({
147147
},
148148
div({
149149
ref: "content",
150+
style: this.props.style,
150151
className: cx(this.buildClassName('content'), this.props.className),
151152
tabIndex: "-1",
152153
onClick: stopPropagation,

specs/Modal.spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ describe('Modal', function () {
110110
unmountModal();
111111
});
112112

113+
it('supports adding style to the modal contents', function () {
114+
var modal = renderModal({isOpen: true, style: {width: '20px'}});
115+
equal(modal.portal.refs.content.getDOMNode().style.width, '20px');
116+
});
117+
113118
it('adds --after-open for animations', function() {
114119
var modal = renderModal({isOpen: true});
115120
var overlay = document.querySelector('.ReactModal__Overlay');

0 commit comments

Comments
 (0)