diff --git a/src/components/swipe-action/index.en.md b/src/components/swipe-action/index.en.md index ede2be1e01..750aee9eb9 100644 --- a/src/components/swipe-action/index.en.md +++ b/src/components/swipe-action/index.en.md @@ -8,7 +8,7 @@ Swipe to reveal hidden function menus. ## Demos - +`` ## SwipeAction @@ -23,6 +23,7 @@ Swipe to reveal hidden function menus. | onAction | Triggered when operation button is clicked | `(action: Action, e: React.MouseEvent) => void` | - | | stopPropagation | Stop the propagation of some events. | `PropagationEvent[]` | `[]` | | onActionsReveal | Triggered when the operation button appears completely | `(side: 'left' \| 'right') => void` | - | +| onActionsClose | Triggered when the slider is closed | `() => void` | - | ### Action diff --git a/src/components/swipe-action/index.zh.md b/src/components/swipe-action/index.zh.md index b9dbcc08bf..e063bbf7d8 100644 --- a/src/components/swipe-action/index.zh.md +++ b/src/components/swipe-action/index.zh.md @@ -8,7 +8,7 @@ ## 示例 - +`` ## SwipeAction @@ -23,6 +23,7 @@ | onAction | 点击操作按钮时触发 | `(action: Action, e: React.MouseEvent) => void` | - | | stopPropagation | 阻止某些事件的冒泡 | `PropagationEven[]` | `[]` | | onActionsReveal | 按钮完全出现时触发 | `(side: 'left' \| 'right') => void` | - | +| onActionsClose | 滑块关闭时触发 | `() => void` | - | ### Action diff --git a/src/components/swipe-action/swipe-action.tsx b/src/components/swipe-action/swipe-action.tsx index d519c3db70..37fa0e39ea 100644 --- a/src/components/swipe-action/swipe-action.tsx +++ b/src/components/swipe-action/swipe-action.tsx @@ -50,6 +50,7 @@ export type SwipeActionProps = { children: ReactNode stopPropagation?: PropagationEvent[] onActionsReveal?: (side: SideType) => void + onActionsClose?: () => void } & NativeProps<'--background'> const defaultProps = { @@ -155,6 +156,7 @@ export const SwipeAction = forwardRef( x: 0, }) forceCancelDrag() + p?.onActionsClose?.() } useImperativeHandle(ref, () => ({