|
|
@ -14,6 +14,9 @@ class AntTag extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
close(e) {
|
|
|
|
close(e) {
|
|
|
|
let dom = React.findDOMNode(this);
|
|
|
|
let dom = React.findDOMNode(this);
|
|
|
|
|
|
|
|
dom.style.width = dom.offsetWidth + 'px';
|
|
|
|
|
|
|
|
// It's Magic Code, don't know why
|
|
|
|
|
|
|
|
dom.style.width = dom.offsetWidth + 'px';
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
closing: true
|
|
|
|
closing: true
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -26,11 +29,6 @@ class AntTag extends React.Component {
|
|
|
|
this.props.onClose.call(this, e);
|
|
|
|
this.props.onClose.call(this, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
let dom = React.findDOMNode(this);
|
|
|
|
|
|
|
|
dom.style.width = (dom.getBoundingClientRect().width || dom.offsetWidth) + 'px';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let close = this.props.closable ?
|
|
|
|
let close = this.props.closable ?
|
|
|
|
<i className="anticon anticon-cross" onClick={this.close.bind(this)}></i> : '';
|
|
|
|
<i className="anticon anticon-cross" onClick={this.close.bind(this)}></i> : '';
|
|
|
|