Skip to content

Commit 2ecac68

Browse files
committedAug 4, 2015
[fixed] Modal uses provided className again
1 parent 9403a81 commit 2ecac68

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
 

Diff for: ‎src/Modal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const Modal = React.createClass({
163163
let modal = (
164164
<Dialog {...props}
165165
ref={this._setDialogRef}
166-
className={classNames({ in: show && !animation })}
166+
className={classNames(this.props.className, { in: show && !animation })}
167167
onClick={backdrop === true ? this.handleBackdropClick : null}
168168
>
169169
{ this.renderContent() }

Diff for: ‎test/ModalSpec.js

+13
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,19 @@ describe('Modal', function () {
130130
ReactTestUtils.Simulate.click(button);
131131
});
132132

133+
it('Should pass className to the dialog', function () {
134+
let noOp = function () {};
135+
let instance = render(
136+
<Modal show className='mymodal' onHide={noOp}>
137+
<strong>Message</strong>
138+
</Modal>
139+
, mountPoint);
140+
141+
let dialog = React.findDOMNode(instance.refs.dialog);
142+
143+
assert.ok(dialog.className.match(/\bmymodal\b/));
144+
});
145+
133146
it('Should use bsClass on the dialog', function () {
134147
let noOp = function () {};
135148
let instance = render(

0 commit comments

Comments
 (0)