From 12e99479d3f01116e9c4965edc0cb27f8a46b181 Mon Sep 17 00:00:00 2001 From: reonce Date: Wed, 24 Apr 2024 21:19:51 +0800 Subject: [PATCH 1/3] fix: dropdown separate title and content when scrolling --- src/components/dropdown/dropdown.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/dropdown/dropdown.less b/src/components/dropdown/dropdown.less index b69d9c9633..7c337ff174 100644 --- a/src/components/dropdown/dropdown.less +++ b/src/components/dropdown/dropdown.less @@ -78,7 +78,7 @@ left: 0; .@{class-prefix-dropdown}-popup-mask { - position: absolute; + position: fixed; } .@{class-prefix-dropdown}-popup-body { From d390ed2be677622aaa56046a25cf8fb42039b2a9 Mon Sep 17 00:00:00 2001 From: reonce Date: Wed, 24 Apr 2024 21:43:20 +0800 Subject: [PATCH 2/3] feat: swipeAction onClose event --- src/components/swipe-action/index.en.md | 3 ++- src/components/swipe-action/index.zh.md | 3 ++- src/components/swipe-action/swipe-action.tsx | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) 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, () => ({ From 2cbeb2b8fa951fa4c39b070cb3997ead374e3490 Mon Sep 17 00:00:00 2001 From: reonce Date: Wed, 24 Apr 2024 21:45:49 +0800 Subject: [PATCH 3/3] feat: swipeAction onClose event --- src/components/dropdown/dropdown.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/dropdown/dropdown.less b/src/components/dropdown/dropdown.less index 7c337ff174..b69d9c9633 100644 --- a/src/components/dropdown/dropdown.less +++ b/src/components/dropdown/dropdown.less @@ -78,7 +78,7 @@ left: 0; .@{class-prefix-dropdown}-popup-mask { - position: fixed; + position: absolute; } .@{class-prefix-dropdown}-popup-body {