react-component / motion

⛷ CSS Animation for React
https://motion-seven.vercel.app
MIT License
146 stars 41 forks source link

fix: kip useless active #25

Closed zombieJ closed 2 years ago

zombieJ commented 2 years ago

游览器在切换 Tab 时动画会暂停,在切换回来时有小概率遇到游览器回复动画触发 motionEnd 但是 CSSMotion 已经进入下一个动画状态被强制重置的情况。加一个判断,只有在流程中的 status 才可以被中断。

https://github.com/ant-design/ant-design/pull/34319#issuecomment-1084068312

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/motion/2cwpKHKY2JhfvA2LiqbfPDisE38g
✅ Preview: https://motion-git-fix-active-react-component.vercel.app

codecov[bot] commented 2 years ago

Codecov Report

Merging #25 (b828215) into master (757821e) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #25   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files          11       11           
  Lines         351      352    +1     
  Branches       94       96    +2     
=======================================
+ Hits          345      346    +1     
  Misses          6        6           
Impacted Files Coverage Δ
src/hooks/useStatus.ts 100.00% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more