Explorar o código

feat: [Collapsible] add onMotionEnd callback for new Collapsible

zhangyumei.0319 %!s(int64=3) %!d(string=hai) anos
pai
achega
5b06ebbf93
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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"