Skip to content

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jul 29, 2020

横向快速移动鼠标,tooltip 会不消失:
https://codesandbox.io/s/beautiful-faraday-zfmgw?file=/index.js

原因在于 setState 是异步操作被 batch update,导致 motion 没有启动就被结束,而 Trigger 层以为已经触发了 motion 就继续执行锁逻辑导致 PopupInner 弹出后没人管的状态。

这个 fix 添加了一个额外的事件监听用于检查是否真的在进行动画。可能会有新 bug,随遇随修。

@zombieJ zombieJ requested review from afc163 and 07akioni July 29, 2020 07:03
@zombieJ zombieJ changed the title fix: Motion state record [WIP] fix: Motion state record Jul 29, 2020
@afc163
Copy link
Member

afc163 commented Jul 29, 2020

怎么发现的...

@codecov
Copy link

codecov bot commented Jul 29, 2020

Codecov Report

Merging #188 into master will decrease coverage by 0.30%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #188      +/-   ##
==========================================
- Coverage   85.74%   85.43%   -0.31%     
==========================================
  Files           7        7              
  Lines         505      508       +3     
  Branches      146      143       -3     
==========================================
+ Hits          433      434       +1     
- Misses         72       74       +2     
Impacted Files Coverage Δ
src/Popup.tsx 89.78% <71.42%> (-1.27%) ⬇️

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 5b2c27e...766f39d. Read the comment docs.

@zombieJ
Copy link
Member Author

zombieJ commented Jul 29, 2020

语雀同学报的

@zombieJ zombieJ changed the title [WIP] fix: Motion state record fix: Motion state record Jul 29, 2020
@afc163
Copy link
Member

afc163 commented Jul 29, 2020

语雀那个问题是突然出现的,而且他们应该还用的是 antd 3.x,可能不是这个问题。

@zombieJ
Copy link
Member Author

zombieJ commented Jul 29, 2020

他们最近升级完 v4 了,只是为了保持品牌一致性所以一些 design token 改成了 v3 的。组件已经是新的了。

@zombieJ zombieJ merged commit 981acac into master Jul 29, 2020
@delete-merged-branch delete-merged-branch bot deleted the fix-stuck branch July 29, 2020 07:33
@zombieJ
Copy link
Member Author

zombieJ commented Jul 29, 2020

#189 先 revert 掉,我看看是啥原因

zombieJ added a commit that referenced this pull request Jul 29, 2020
zombieJ added a commit that referenced this pull request Jul 29, 2020
@zombieJ
Copy link
Member Author

zombieJ commented Jul 29, 2020

onMotionEvent 死循环了,先回滚再 patch 一个版本

zombieJ added a commit that referenced this pull request Jul 29, 2020
* fix: Motion state record

* update test case
@zombieJ zombieJ mentioned this pull request Jul 29, 2020
zombieJ added a commit that referenced this pull request Jul 29, 2020
* fix: Motion state record (#188)

* fix: Motion state record

* update test case

* fix: Motion state record
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