diff --git a/src/DropdownMenu.js b/src/DropdownMenu.js index 17ec1d8e89..fa0c355863 100644 --- a/src/DropdownMenu.js +++ b/src/DropdownMenu.js @@ -80,37 +80,36 @@ class DropdownMenu extends React.Component { } render() { - const items = ValidComponentChildren.map(this.props.children, child => { - let { - children, - onKeyDown, - onSelect - } = child.props || {}; + let {children, onSelect, pullRight, className, labelledBy, open, onClose, ...props} = this.props; + + const items = ValidComponentChildren.map(children, child => { + let childProps = child.props || {}; return React.cloneElement(child, { - onKeyDown: createChainedFunction(onKeyDown, this.handleKeyDown), - onSelect: createChainedFunction(onSelect, this.props.onSelect) - }, children); + onKeyDown: createChainedFunction(childProps.onKeyDown, this.handleKeyDown), + onSelect: createChainedFunction(childProps.onSelect, onSelect) + }, childProps.children); }); const classes = { 'dropdown-menu': true, - 'dropdown-menu-right': this.props.pullRight + 'dropdown-menu-right': pullRight }; let list = (