Skip to content

Commit 4bb72c1

Browse files
authored
fix(dialog): ensure handleClick is defined before invoking in useSameTarget (#5672)
* fix(dialog): ensure handleClick is defined before invoking in useSameTarget * chore: 使用可选链避免函数调用不存在
1 parent 86bddbb commit 4bb72c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/components/dialog/hooks/useSameTarget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function useSameTarget(handleClick?: (e: MouseEvent) => void) {
55

66
const onClick = (e: MouseEvent) => {
77
if (MOUSEDOWN_TARGET && MOUSEUP_TARGET) {
8-
handleClick(e);
8+
handleClick?.(e);
99
}
1010
MOUSEDOWN_TARGET = false;
1111
MOUSEUP_TARGET = false;

0 commit comments

Comments
 (0)