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: fix onclose/onPreivew call twice when click the edge of closeIcon #2027

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

YyumeiZhang
Copy link
Collaborator

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

Fixes #

原来的代码中在 mask 的回调中有判断当前点击位置的是否为 icon /footer 部分,如果是,则不关闭预览。对于关闭按钮,点击边缘部分(即 section 中不属于 icon 的部分),则 关闭按钮和 mask 中的回调都会被触发,从而导致 onVisible 调用两次
image

Changelog

🇨🇳 Chinese

  • Fix: 修复 ImagePreview 组件在预览时点击关闭按钮边缘时触发 onClose/onPreview 两次问题

🇺🇸 English

  • Fix: Fixed the problem of triggering onClose/onPreview twice when clicking the edge of the close button in the preview state in the ImagePreview component

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (5a554bf) 87.43% compared to head (61b99cb) 87.37%.
Report is 3 commits behind head on main.

❗ Current head 61b99cb differs from pull request most recent head f46ed65. Consider uploading reports for the commit f46ed65 to get more accurate results

Files Patch % Lines
...es/semi-foundation/image/previewInnerFoundation.ts 66.66% 1 Missing ⚠️
packages/semi-ui/image/previewInner.tsx 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2027      +/-   ##
==========================================
- Coverage   87.43%   87.37%   -0.06%     
==========================================
  Files         437      437              
  Lines       25661    25665       +4     
  Branches     6504     6504              
==========================================
- Hits        22436    22426      -10     
- Misses       3225     3239      +14     

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

Copy link

codesandbox-ci bot commented Jan 18, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f46ed65:

Sandbox Source
pr-story Configuration
Semi Design: Simple Story Configuration

Copy link

cypress bot commented Jan 18, 2024

Passing run #2188 ↗︎

0 216 10 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge f46ed65 into c81cf78...
Project: semi-design Commit: 61b99cbf1c ℹ️
Status: Passed Duration: 08:20 💡
Started: Jan 18, 2024 9:49 AM Ended: Jan 18, 2024 9:57 AM

Review all test suite changes for PR #2027 ↗︎

@YyumeiZhang YyumeiZhang merged commit 92ca8e2 into main Jan 19, 2024
9 checks passed
@YyumeiZhang YyumeiZhang deleted the fix/image-close-cb2 branch January 19, 2024 06:04
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.

4 participants