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 trigger repeat animation #297

Merged
merged 2 commits into from
Nov 6, 2019
Merged

Conversation

shaodahong
Copy link
Member

@vercel
Copy link

vercel bot commented Nov 4, 2019

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

🔍 Inspect: https://zeit.co/react-component/menu/8dkhh3j92
🌍 Preview: https://menu-git-fix-trigger-repeat-animation.react-component.now.sh

@shaodahong
Copy link
Member Author

这样应该就可以了,popup 有自己的动画,rc-trigger 只是提供 trigger 功能就行

@codecov
Copy link

codecov bot commented Nov 4, 2019

Codecov Report

Merging #297 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
- Coverage   93.74%   93.72%   -0.02%     
==========================================
  Files          11       11              
  Lines         799      797       -2     
  Branches      229      229              
==========================================
- Hits          749      747       -2     
  Misses         50       50
Impacted Files Coverage Δ
src/SubMenu.tsx 97.97% <100%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f6c3c6...f54ab5b. Read the comment docs.

@zombieJ
Copy link
Member

zombieJ commented Nov 6, 2019

看看是不是应该在 rc-dropdown 里调整一下,rc-menu 比较底层。这里兼容性方法删了容易让其他没有改用新版的挂掉。

@shaodahong
Copy link
Member Author

看看是不是应该在 rc-dropdown 里调整一下,rc-menu 比较底层。这里兼容性方法删了容易让其他没有改用新版的挂掉。

rc-dropdown 没关系,现在的问题根源是 rc-menu 的重复动画,单独用 rc-menu 也是有问题的,这个删了应该问题不大,毕竟 subMenu 是有 cssMotion 控制的,你传入 motionName 也是可以定义动画的

@shaodahong
Copy link
Member Author

V7 版本我刚才看了也是没有的,popupMotion 是 V8 刚加的

@zombieJ
Copy link
Member

zombieJ commented Nov 6, 2019

单独用 rc-menu 也是有问题的

能给个重现看看吗?这个 motion 做兼容特地加的,我看看是我哪里疏忽了。

@shaodahong
Copy link
Member Author

shaodahong commented Nov 6, 2019

单独用 rc-menu 也是有问题的

能给个重现看看吗?这个 motion 做兼容特地加的,我看看是我哪里疏忽了。

https://deploy-preview-19498--ant-design.netlify.com/components/menu-cn/#components-menu-demo-vertical

你看下这个 menu 的动画

ant-design/ant-design#19498 (comment) 这个得截图也是上面的例子

@zombieJ
Copy link
Member

zombieJ commented Nov 6, 2019

@zombieJ
Copy link
Member

zombieJ commented Nov 6, 2019

嗯,你是对的。我发个版看看效果。

@zombieJ zombieJ merged commit 836d24c into master Nov 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-trigger-repeat-animation branch November 6, 2019 05:22
@zombieJ
Copy link
Member

zombieJ commented Nov 6, 2019

+ rc-menu@8.0.0-alpha.3

@shaodahong
Copy link
Member Author

还有个问题,v3 也是有的,隐藏的时候动画还没有结束再触发就会有这种

Kapture 2019-11-06 at 14 43 36

@zombieJ
Copy link
Member

zombieJ commented Nov 6, 2019

如果 v3 也有,可以先放放。升级优先级更高些。

popupClassName={`${prefixCls}-popup ${popupClassName}`}
popupClassName={classNames(`${prefixCls}-popup`, {
[props.popupClassName]:
props.mode !== 'inline' && props.popupClassName,
Copy link
Member

Choose a reason for hiding this comment

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

上面的代码里把 popupClassName 删了,这里一直空的。

Copy link
Member Author

@shaodahong shaodahong Nov 7, 2019

Choose a reason for hiding this comment

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

……我说怎么一直都是 undefined, 所以我换成这个写法了,没看到,我修复下

Copy link
Member Author

Choose a reason for hiding this comment

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

之前没用 classNames 所以我看到页面渲染出 undefined 就换成这个了

Copy link
Member

Choose a reason for hiding this comment

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

不用了,已经 patch 了

@afc163
Copy link
Member

afc163 commented Jun 30, 2020

close ant-design/ant-design#19602

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.

3 participants