Skip to content

Commit

Permalink
fix(Popup): fix disabled API doesn't work (#2665)
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn authored Dec 14, 2023
1 parent b8092f1 commit 2ba80f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/popup/hooks/useTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export default function useTrigger({ content, disabled, trigger, visible, onVisi
const leaveFlag = useRef(false); // 防止多次触发显隐

// 禁用和无内容时不展示
const shouldToggle = !disabled && content === 0 ? true : content;
const shouldToggle = useMemo(() => {
if (disabled) return false; // 禁用
return !disabled && content === 0 ? true : content; // 无内容时
}, [disabled, content]);

// 解析 delay 数据类型
const [appearDelay = 0, exitDelay = 0] = useMemo(() => {
Expand Down

0 comments on commit 2ba80f5

Please sign in to comment.