From 4f381b03011d876468e72f4a40ec5b87d8504946 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Fri, 7 Aug 2015 19:21:02 +0800 Subject: [PATCH] fix #120 --- components/popconfirm/index.jsx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/components/popconfirm/index.jsx b/components/popconfirm/index.jsx index 231baed17e..eb16b1d41e 100644 --- a/components/popconfirm/index.jsx +++ b/components/popconfirm/index.jsx @@ -13,22 +13,29 @@ export default React.createClass({ transitionName: '', placement: 'top', trigger: 'click', - onConfirm: function() {}, - onCancel: function() {} + onConfirm: function () { + }, + onCancel: function () { + } }; }, - confirm: function() { + confirm: function () { this.props.onConfirm.call(this); this.setState({ visible: false }); }, - cancel: function() { + cancel: function () { this.props.onCancel.call(this); this.setState({ visible: false }); }, + onVisibleChange(v){ + this.setState({ + visible: v + }); + }, render() { const overlay =
@@ -36,6 +43,7 @@ export default React.createClass({ {this.props.title}

+
@@ -52,12 +60,13 @@ export default React.createClass({ return ( + prefixCls={prefixCls} + renderPopupToBody={false} + onVisibleChange={this.onVisibleChange} + transitionName={transitionName} + visible={this.state.visible} + trigger={this.props.trigger} + overlay={overlay}> {this.props.children} );