From a5acd379f7fb28edd0d76d40dfed7228ce04bddb Mon Sep 17 00:00:00 2001
From: chenjiahan <chenjiahan@youzan.com>
Date: Tue, 25 Feb 2020 19:04:00 +0800
Subject: [PATCH] feat(ActionSheet): add close-on-popstate prop (#5716)

---
 src/action-sheet/README.md       | 1 +
 src/action-sheet/README.zh-CN.md | 1 +
 src/action-sheet/index.tsx       | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/src/action-sheet/README.md b/src/action-sheet/README.md
index 6ad853c0a..4fe07bb59 100644
--- a/src/action-sheet/README.md
+++ b/src/action-sheet/README.md
@@ -133,6 +133,7 @@ export default {
 | overlay | Whether to show overlay | *boolean* | `true` |
 | lock-scroll | Whether to lock background scroll | *boolean* | `true` |
 | lazy-render | Whether to lazy render util appeared | *boolean* | `true`  |
+| close-on-popstate `v2.5.3` | Whether to close when popstate | *boolean* | `false` |
 | close-on-click-action | Whether to close when click action | *boolean* | `false` |
 | close-on-click-overlay | Whether to close when click overlay | *boolean* | `true` |
 | safe-area-inset-bottom | Whether to enable bottom safe area adaptation | *boolean* | `true` |
diff --git a/src/action-sheet/README.zh-CN.md b/src/action-sheet/README.zh-CN.md
index 20724727e..d22ea5778 100644
--- a/src/action-sheet/README.zh-CN.md
+++ b/src/action-sheet/README.zh-CN.md
@@ -147,6 +147,7 @@ export default {
 | overlay | 是否显示遮罩层 | *boolean* | `true` |
 | lock-scroll | 是否锁定背景滚动 | *boolean* | `true` |
 | lazy-render | 是否在显示弹层时才渲染节点 | *boolean* | `true` |
+| close-on-popstate `v2.5.3` | 是否在页面回退时自动关闭 | *boolean* | `false` |
 | close-on-click-action | 是否在点击选项后关闭 | *boolean* | `false` |
 | close-on-click-overlay | 是否在点击遮罩层后关闭 | *boolean* | `true` |
 | safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | *boolean* | `true` |
diff --git a/src/action-sheet/index.tsx b/src/action-sheet/index.tsx
index 4e967011d..3bd38b011 100644
--- a/src/action-sheet/index.tsx
+++ b/src/action-sheet/index.tsx
@@ -34,6 +34,7 @@ export type ActionSheetProps = PopupMixinProps & {
   closeIcon: string;
   cancelText?: string;
   description?: string;
+  closeOnPopstate?: boolean;
   closeOnClickAction?: boolean;
   safeAreaInsetBottom?: boolean;
 };
@@ -143,6 +144,7 @@ function ActionSheet(
       lazyRender={props.lazyRender}
       lockScroll={props.lockScroll}
       getContainer={props.getContainer}
+      closeOnPopstate={props.closeOnPopstate}
       closeOnClickOverlay={props.closeOnClickOverlay}
       safeAreaInsetBottom={props.safeAreaInsetBottom}
       {...inherit(ctx, true)}
@@ -164,6 +166,7 @@ ActionSheet.props = {
   cancelText: String,
   description: String,
   getContainer: [String, Function],
+  closeOnPopstate: Boolean,
   closeOnClickAction: Boolean,
   round: {
     type: Boolean,