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

enhance: delete drag lock. add leave view back to zoom #6317

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

1587315093
Copy link
Contributor

@1587315093 1587315093 commented Aug 15, 2023

resolve #6310

主要改动就是删除了 dragLockRef 这个拖动锁,然后把 slide 的冒泡删了,不然外层的· drag不触发。

然后加这段代码是最小改动,离开视图回到原始缩放

 const [inView] = useInViewport(controlRef)

  useEffect(() => {
    !inView &&
      api.start({
        matrix: mat.create(),
      })
  }, [inView])

@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.47% 🎉

Comparison is base (e8f6c15) 91.05% compared to head (fa2ad8f) 91.53%.
Report is 14 commits behind head on feature.

Additional details and impacted files
@@             Coverage Diff             @@
##           feature    #6317      +/-   ##
===========================================
+ Coverage    91.05%   91.53%   +0.47%     
===========================================
  Files          307      310       +3     
  Lines         6597     6661      +64     
  Branches      1644     1654      +10     
===========================================
+ Hits          6007     6097      +90     
+ Misses         544      531      -13     
+ Partials        46       33      -13     
Files Changed Coverage Δ
src/components/image-viewer/image-viewer.tsx 100.00% <100.00%> (+4.65%) ⬆️
src/components/image-viewer/slide.tsx 65.74% <100.00%> (+7.33%) ⬆️
src/components/image-viewer/slides.tsx 90.69% <100.00%> (+0.22%) ⬆️

... and 48 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6317.surge.sh

@1587315093
Copy link
Contributor Author

1587315093 commented Aug 17, 2023

考古到一个相关的PR #5701,应该选一下实现方式吧

@1587315093 1587315093 closed this Aug 17, 2023
@1587315093 1587315093 reopened this Aug 17, 2023
@zombieJ zombieJ merged commit b31e392 into ant-design:feature Sep 11, 2023
7 checks passed
@miracles1919
Copy link
Contributor

删除锁会导致缩小、放大的操作误认为滑动的

miracles1919 added a commit that referenced this pull request Sep 11, 2023
miracles1919 added a commit that referenced this pull request Sep 11, 2023
Revert "enhance: delete drag lock. add leave view back to zoom (#6317)"

This reverts commit b31e392.
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