Skip to content

Commit

Permalink
[fixed] Modal uses provided className again
Browse files Browse the repository at this point in the history
  • Loading branch information
aforty committed Aug 4, 2015
1 parent 9403a81 commit 2ecac68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const Modal = React.createClass({
let modal = (
<Dialog {...props}
ref={this._setDialogRef}
className={classNames({ in: show && !animation })}
className={classNames(this.props.className, { in: show && !animation })}
onClick={backdrop === true ? this.handleBackdropClick : null}
>
{ this.renderContent() }
Expand Down
13 changes: 13 additions & 0 deletions test/ModalSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ describe('Modal', function () {
ReactTestUtils.Simulate.click(button);
});

it('Should pass className to the dialog', function () {
let noOp = function () {};
let instance = render(
<Modal show className='mymodal' onHide={noOp}>
<strong>Message</strong>
</Modal>
, mountPoint);

let dialog = React.findDOMNode(instance.refs.dialog);

assert.ok(dialog.className.match(/\bmymodal\b/));
});

it('Should use bsClass on the dialog', function () {
let noOp = function () {};
let instance = render(
Expand Down

0 comments on commit 2ecac68

Please sign in to comment.