mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-10 19:19:20 +08:00
Fix DropdownButton onClick behavious, should respond left button only
This commit is contained in:
parent
63e110fbc6
commit
d0b2bdad84
@ -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) {
|
||||
|
@ -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" />
|
||||
|
Loading…
Reference in New Issue
Block a user