diff --git a/src/DropdownButton.js b/src/DropdownButton.js index d24e656d63..7110c6505a 100644 --- a/src/DropdownButton.js +++ b/src/DropdownButton.js @@ -36,7 +36,7 @@ const DropdownButton = React.createClass({ {...this.props} ref="dropdownButton" className={classNames('dropdown-toggle', this.props.buttonClassName)} - onClick={this.handleDropdownClick} + onClick={createChainedFunction(this.props.onClick, this.handleDropdownClick)} key={0} navDropdown={this.props.navItem} navItem={null} diff --git a/test/DropdownButtonSpec.js b/test/DropdownButtonSpec.js index 4a85540b05..cfc906383a 100644 --- a/test/DropdownButtonSpec.js +++ b/test/DropdownButtonSpec.js @@ -213,4 +213,22 @@ describe('DropdownButton', function () { let button = ReactTestUtils.findRenderedComponentWithType(instance, Button).getDOMNode(); assert.ok(button.className.match(/\btest-class\b/)); }); + + it('should set onClick on Button', function (done) { + function handleClick() { + done(); + } + + instance = ReactTestUtils.renderIntoDocument( + + MenuItem 1 content + MenuItem 2 content + + ); + + let button = ReactTestUtils.findRenderedComponentWithType(instance, Button); + ReactTestUtils.SimulateNative.click( + ReactTestUtils.findRenderedDOMComponentWithClass(button, 'dropdown-toggle') + ); + }); });