Fix DropdownButton onClick behavious, should respond left button only

This commit is contained in:
afc163 2016-04-18 17:23:22 +08:00
parent 63e110fbc6
commit d0b2bdad84
2 changed files with 4 additions and 4 deletions

View File

@ -10,8 +10,8 @@
import { Menu, Dropdown } from 'antd';
const DropdownButton = Dropdown.Button;
function handleButtonClick() {
console.log('click button');
function handleButtonClick(e) {
console.log('click left button', e);
}
function handleMenuClick(e) {

View File

@ -21,14 +21,14 @@ export default React.createClass({
};
},
render() {
const { type, overlay, trigger, align, children, className, ...restProps } = this.props;
const { type, overlay, trigger, align, children, className, onClick, ...restProps } = this.props;
const cls = classNames({
'ant-dropdown-button': true,
className: !!className,
});
return (
<ButtonGroup {...restProps} className={cls}>
<Button type={type}>{children}</Button>
<Button type={type} onClick={onClick}>{children}</Button>
<Dropdown align={align} overlay={overlay} trigger={trigger}>
<Button type={type}>
<Icon type="down" />