mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 13:47:02 +08:00
Merge pull request #1267 from mrtone/patch-1
preventDefault for onClose.
This commit is contained in:
commit
5ecd21a732
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user