-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: appeared again after closing and disappeared very quickly #39
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
tests/CSSMotion.spec.tsx
Outdated
motionName="transition" | ||
visible={visible} | ||
removeOnLeave={false} | ||
leavedClassName={'removed'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边设置 leavedClassName
后,下面测试需要移除掉 leavedClassName
才能测出上面的逻辑。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Codecov Report
@@ Coverage Diff @@
## master #39 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 11 11
Lines 371 371
Branches 106 106
=======================================
Hits 365 365
Misses 6 6
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
motionChildren = children( | ||
{ ...mergedProps, className: leavedClassName }, | ||
setNodeRef, | ||
); | ||
} else if (forceRender) { | ||
} else if ( forceRender || (!removeOnLeave && !leavedClassName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!removeOnLeave 的情况因为没有 leavedCLassName 会走到最后的 motionChildren = null 分支, 在forceRender 加上(!removeOnLeave && !leavedClassName) 兜底变成 style 注入,覆盖到 !removeOnleave的情况.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多了空格
低配置机型开启cpu 六倍降速还是会偶现关闭Modal出现闪动问题。 |
fix ant-design/ant-design#39013
bug复现方法: