From 56b0650734fe0f082eae8c018a521a02b63df0a6 Mon Sep 17 00:00:00 2001 From: "Mr.Tone" Date: Thu, 24 Mar 2016 22:12:21 +0800 Subject: [PATCH] preventDefault for onClose. --- components/tag/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/tag/index.jsx b/components/tag/index.jsx index cd9b9fd034..b441785d73 100644 --- a/components/tag/index.jsx +++ b/components/tag/index.jsx @@ -15,6 +15,8 @@ export default class Tag extends React.Component { } close(e) { + this.props.onClose(e); + if(e.defaultPrevented) return; const dom = ReactDOM.findDOMNode(this); dom.style.width = `${dom.offsetWidth}px`; // It's Magic Code, don't know why @@ -22,7 +24,6 @@ export default class Tag extends React.Component { this.setState({ closing: true, }); - this.props.onClose(e); } animationEnd(key, existed) {