Skip to content
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

Merged
merged 4 commits into from
Jan 9, 2023

Conversation

heiyu4585
Copy link
Contributor

@heiyu4585 heiyu4585 commented Jan 8, 2023

fix ant-design/ant-design#39013

bug复现方法:
image

@vercel
Copy link

vercel bot commented Jan 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
motion ✅ Ready (Inspect) Visit Preview Jan 9, 2023 at 7:52AM (UTC)

motionName="transition"
visible={visible}
removeOnLeave={false}
leavedClassName={'removed'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这边设置 leavedClassName 后,下面测试需要移除掉 leavedClassName 才能测出上面的逻辑。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #39 (82d9538) into master (d164f7f) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #39   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files          11       11           
  Lines         371      371           
  Branches      106      106           
=======================================
  Hits          365      365           
  Misses          6        6           
Impacted Files Coverage Δ
src/CSSMotion.tsx 98.14% <100.00%> (ø)

📣 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)) {
Copy link
Contributor Author

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的情况.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多了空格

@usedlife
Copy link

低配置机型开启cpu 六倍降速还是会偶现关闭Modal出现闪动问题。
antd版本:5.2.1,2.6GHz 六核 Intel Core i7 处理器(19款MBP),复现组件 Modal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal嵌套Form关闭之后闪烁
4 participants