Browse Source

fix: remove dead click-outside handler in FloatingNodeHeader

The useEffect registered an event listener whose handler body was
empty (only a comment stub), so it added overhead with no behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
b56798e9a8
  1. 20
      src/components/nodes/FloatingNodeHeader.tsx

20
src/components/nodes/FloatingNodeHeader.tsx

@ -187,26 +187,6 @@ export const FloatingNodeHeader = memo(function FloatingNodeHeader({
return () => document.removeEventListener("mousedown", handleClickOutside); return () => document.removeEventListener("mousedown", handleClickOutside);
}, [isEditingComment, handleCommentSubmit]); }, [isEditingComment, handleCommentSubmit]);
// Click outside handler for focused comment tooltip
useEffect(() => {
const handleClickOutsideTooltip = (e: MouseEvent) => {
if (tooltipRef.current && !tooltipRef.current.contains(e.target as Node)) {
// Clear focused comment (would need to be passed as a callback)
}
};
if (isCommentFocused && !isEditingComment) {
const timer = setTimeout(() => {
document.addEventListener("mousedown", handleClickOutsideTooltip);
}, 100);
return () => {
clearTimeout(timer);
document.removeEventListener("mousedown", handleClickOutsideTooltip);
};
}
return () => document.removeEventListener("mousedown", handleClickOutsideTooltip);
}, [isCommentFocused, isEditingComment]);
// Determine if controls should be visible // Determine if controls should be visible
const showControls = isHovered || selected; const showControls = isHovered || selected;

Loading…
Cancel
Save