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

feat: Add keepAlign support #36

Merged
merged 2 commits into from
Jan 6, 2020
Merged

feat: Add keepAlign support #36

merged 2 commits into from
Jan 6, 2020

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Jan 6, 2020

之前为了性能,把每次渲染都同步一次的逻辑去掉了。这导致了 Slider 这种利用不断更新达到保持坐标同步的效果失效了。但是变回旧版还是嫌太浪费性能,添加一个 keepAlign 的属性,额外处理那些需要实时保持同步的组件。

rc-trigger 也会同步升级一下。

ref: ant-design/ant-design#20677

@zombieJ zombieJ requested review from afc163 and shaodahong January 6, 2020 09:30
@vercel
Copy link

vercel bot commented Jan 6, 2020

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/align/qxjhgzjd1
✅ Preview: https://align-git-fix-position.react-component.now.sh

@codecov
Copy link

codecov bot commented Jan 6, 2020

Codecov Report

Merging #36 into master will increase coverage by 0.54%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   91.93%   92.48%   +0.54%     
==========================================
  Files           3        3              
  Lines         124      133       +9     
  Branches       27       33       +6     
==========================================
+ Hits          114      123       +9     
  Misses         10       10
Impacted Files Coverage Δ
src/Align.tsx 98.82% <100%> (+0.13%) ⬆️

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 21a8a99...df43684. Read the comment docs.

@afc163
Copy link
Member

afc163 commented Jan 6, 2020

这个是不是吧 Slider tooltip 的 getPopupContianer 改到圆点上就行了。

@zombieJ
Copy link
Member Author

zombieJ commented Jan 6, 2020

考虑过,但是如果外部容器是 overflow: hidden。这个就变成 breaking change 了。

@afc163
Copy link
Member

afc163 commented Jan 6, 2020

考虑过,但是如果外部容器是 overflow: hidden。这个就变成 breaking change 了。

确实

@afc163
Copy link
Member

afc163 commented Jan 6, 2020

但是体验会好很多,而且感觉这才是对的,动态更新位置只能算 workaround。

@zombieJ
Copy link
Member Author

zombieJ commented Jan 6, 2020

Sorry. 没看到这个。看看现在的方案:ant-design/ant-design#20699

这个 PR 没用了,Revert 掉。

zombieJ added a commit that referenced this pull request Jan 6, 2020
zombieJ added a commit that referenced this pull request Jan 6, 2020
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.

2 participants