You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
587 B

import TransitionEvents from 'css-animation/lib/Event';
const clickAnimation = (node: HTMLElement) => {
function handler() {
node.removeAttribute('ant-click-animating');
node.setAttribute('ant-click-animating', 'true');
TransitionEvents.addEndEventListener(node, () => {
node.removeAttribute('ant-click-animating');
TransitionEvents.removeEndEventListener(node);
});
}
node.addEventListener('click', handler, false);
return {
cancel: () => {
node.removeEventListener('click', handler, false);
},
};
};
export default clickAnimation;