diff --git a/components/_util/wave.tsx b/components/_util/wave.tsx index ae2918651399..685039b7d237 100644 --- a/components/_util/wave.tsx +++ b/components/_util/wave.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import TransitionEvents from '@ant-design/css-animation/lib/Event'; import { supportRef, composeRef } from 'rc-util/lib/ref'; import raf from './raf'; import { ConfigConsumer, ConfigConsumerProps, CSPConfig, ConfigContext } from '../config-provider'; @@ -106,8 +105,10 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }> if (insertExtraNode) { node.appendChild(extraNode); } - TransitionEvents.addStartEventListener(node, this.onTransitionStart); - TransitionEvents.addEndEventListener(node, this.onTransitionEnd); + ['transition', 'animation'].forEach(name => { + node.addEventListener(`${name}start`, this.onTransitionStart); + node.addEventListener(`${name}end`, this.onTransitionEnd); + }); }; onTransitionStart = (e: AnimationEvent) => { @@ -190,8 +191,10 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }> if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) { node.removeChild(this.extraNode); } - TransitionEvents.removeStartEventListener(node, this.onTransitionStart); - TransitionEvents.removeEndEventListener(node, this.onTransitionEnd); + ['transition', 'animation'].forEach(name => { + node.removeEventListener(`${name}start`, this.onTransitionStart); + node.removeEventListener(`${name}end`, this.onTransitionEnd); + }); } renderWave = ({ csp }: ConfigConsumerProps) => { diff --git a/package.json b/package.json index 63b8115d4a56..63668ead1126 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,6 @@ ], "dependencies": { "@ant-design/colors": "^5.0.0", - "@ant-design/css-animation": "^1.7.2", "@ant-design/icons": "^4.3.0", "@ant-design/react-slick": "~0.27.0", "@babel/runtime": "^7.11.2",