From 706ae5a5b89381b68aa5cfadc6251ca647f42ae8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 28 Jun 2016 16:16:27 +0800 Subject: [PATCH] Fix tag animation --- components/alert/index.jsx | 2 +- components/tag/index.jsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/alert/index.jsx b/components/alert/index.jsx index c87fbc31e7..5035e8f7d3 100644 --- a/components/alert/index.jsx +++ b/components/alert/index.jsx @@ -29,7 +29,7 @@ export default class Alert extends React.Component { this.setState({ closing: false, }); - this.props.onClose.call(this, e); + this.props.onClose(e); } animationEnd = () => { this.setState({ diff --git a/components/tag/index.jsx b/components/tag/index.jsx index 229b821c49..7f54f403f1 100644 --- a/components/tag/index.jsx +++ b/components/tag/index.jsx @@ -25,10 +25,9 @@ export default class Tag extends React.Component { this.props.onClose(e); if (e.defaultPrevented) return; const dom = ReactDOM.findDOMNode(this); - const domWidth = dom.getBoundingClientRect().width; - dom.style.width = `${domWidth}px`; + dom.style.width = `${dom.getBoundingClientRect().width}px`; // It's Magic Code, don't know why - dom.style.width = `${domWidth}px`; + dom.style.width = `${dom.getBoundingClientRect().width}px`; this.setState({ closing: true, });