diff --git a/components/alert/index.jsx b/components/alert/index.jsx index 478dda5f79..525b127561 100644 --- a/components/alert/index.jsx +++ b/components/alert/index.jsx @@ -1,5 +1,4 @@ import React from 'react'; -import { animationEndEvent, addEventListenerOnce } from '../util/index'; import Animate from 'rc-animate'; export default React.createClass({ @@ -16,10 +15,9 @@ export default React.createClass({ }, handleClose(e) { let dom = React.findDOMNode(this); - dom.style.height = dom.offsetHeight + 'px'; // Magic code - // 重复是去除浏览器渲染bug; + // 重复一次后才能正确设置 height dom.style.height = dom.offsetHeight + 'px'; this.setState({ @@ -29,7 +27,7 @@ export default React.createClass({ this.props.onClose.call(this, e); } }, - animationEnd(){ + animationEnd() { this.setState({ closed: true, closing: true @@ -58,8 +56,7 @@ export default React.createClass({ if (this.props.description) { let close = this.props.closable ? - + : ''; html =