From d0b2bdad849d2ec8dc26eade51a980ea2e48f61e Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 18 Apr 2016 17:23:22 +0800 Subject: [PATCH] Fix DropdownButton onClick behavious, should respond left button only --- components/dropdown/demo/dropdown-button.md | 4 ++-- components/dropdown/dropdown-button.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/dropdown/demo/dropdown-button.md b/components/dropdown/demo/dropdown-button.md index c4fddb9d7d..5c06095383 100644 --- a/components/dropdown/demo/dropdown-button.md +++ b/components/dropdown/demo/dropdown-button.md @@ -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) { diff --git a/components/dropdown/dropdown-button.jsx b/components/dropdown/dropdown-button.jsx index 675f97c5c9..2298d8532f 100644 --- a/components/dropdown/dropdown-button.jsx +++ b/components/dropdown/dropdown-button.jsx @@ -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 ( - +