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 closeOnBack to Popup, CenterPopup and other components built on them #6438

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guoyunhe
Copy link
Contributor

@guoyunhe guoyunhe commented Nov 17, 2023

Fix #6436

目前有很多用户已经习惯了手势左滑后退来关闭一些 Popup,比如 Android 版微信的这个 Popup,是可以用手势左滑(后退)关闭的。

image

而 Ant Design Mobile 的 Popup 目前并不支持在检测到后退事件(popstate)时关闭。

建议 Popup 增加此属性,并应用到所有依赖 Popup 的子组件,如 Dialog,Modal,Picker,ActionSheet 等。

closeOnBack: boolean;

用法:

<Popup closeOnBack />

Modal.show({
  closeOnBack: true,
})

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

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

Comparison is base (671ea15) 92.10% compared to head (1cd3e80) 91.94%.

Files Patch % Lines
src/components/center-popup/center-popup.tsx 33.33% 6 Missing ⚠️
src/components/popup/popup.tsx 33.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6438      +/-   ##
==========================================
- Coverage   92.10%   91.94%   -0.16%     
==========================================
  Files         316      316              
  Lines        6861     6877      +16     
  Branches     1719     1723       +4     
==========================================
+ Hits         6319     6323       +4     
- Misses        504      516      +12     
  Partials       38       38              

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

Copy link
Contributor

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

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.

[Popup] 增加 closeOnBack 属性,支持用户手势后退时关闭弹窗,而非退出页面
1 participant