diff --git a/apps/playground/src/helpers/mock-files.ts b/apps/playground/src/helpers/mock-files.ts index 80ea6e3..604e4b5 100644 --- a/apps/playground/src/helpers/mock-files.ts +++ b/apps/playground/src/helpers/mock-files.ts @@ -56,7 +56,7 @@ const tangoConfigJson = { }, '@music163/antd': { description: '云音乐低代码中后台应用基础物料', - version: '0.2.5', + version: '0.2.6', library: 'TangoAntd', type: 'baseDependency', resources: [ diff --git a/packages/ui/src/popover.tsx b/packages/ui/src/popover.tsx index e3670c4..4883d6a 100644 --- a/packages/ui/src/popover.tsx +++ b/packages/ui/src/popover.tsx @@ -97,6 +97,11 @@ export const Popover: React.FC = ({ const handleClick = useCallback( (e: React.MouseEvent) => { e.preventDefault(); + if (visible) { + setVisible(false); + onOpenChange(false); + return; + } const x = e.clientX; const y = e.clientY; setLeft(x); @@ -104,7 +109,7 @@ export const Popover: React.FC = ({ setVisible(true); onOpenChange(true); }, - [onOpenChange], + [visible, onOpenChange], ); useEffect(() => {