浏览代码

feat: [Collapsible] add onMotionEnd callback for new Collapsible

zhangyumei.0319 3 年之前
父节点
当前提交
5b06ebbf93
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/semi-ui/collapsible/index.tsx

+ 3 - 1
packages/semi-ui/collapsible/index.tsx

@@ -22,7 +22,8 @@ interface CollapsibleProps extends CollapsibleFoundationProps {
     style?: React.CSSProperties;
     collapseHeight?: number;
     reCalcKey?: number | string;
-    id?: string
+    id?: string;
+    onMotionEnd?: () => void
 }
 
 interface CollapsibleState extends CollapsibleFoundationState {
@@ -174,6 +175,7 @@ class Collapsible extends BaseComponent<CollapsibleProps, CollapsibleState> {
                 this.foundation.updateVisible(false);
             }
             this.foundation.updateIsTransitioning(false);
+            this.props.onMotionEnd();
         }}>
             <div
                 x-semi-prop="children"