浏览代码

fix: fix dropdown onVisibleChange not defined some time (#2454)

代强 1 年之前
父节点
当前提交
fd051c8198
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/semi-ui/dropdown/index.tsx

+ 1 - 1
packages/semi-ui/dropdown/index.tsx

@@ -134,7 +134,7 @@ class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
         return {
             ...super.adapter,
             setPopVisible: (popVisible: boolean) => this.setState({ popVisible }),
-            notifyVisibleChange: (visible: boolean) => this.props.onVisibleChange(visible),
+            notifyVisibleChange: (visible: boolean) => this.props.onVisibleChange?.(visible),
             getPopupId: () => this.tooltipRef.current.getPopupId()
         };
     }