Skip to content

Fix #396: Right-click Duplicate Node does nothing#409

Open
ErnestHysa wants to merge 2 commits into
ianarawjo:mainfrom
ErnestHysa:fix/396-duplicate-node-context-menu
Open

Fix #396: Right-click Duplicate Node does nothing#409
ErnestHysa wants to merge 2 commits into
ianarawjo:mainfrom
ErnestHysa:fix/396-duplicate-node-context-menu

Conversation

@ErnestHysa
Copy link
Copy Markdown

Fix #396: Right-click Duplicate Node does nothing

Problem

The right-click Duplicate Node action failed on some systems (e.g., Windows 11 LTSC) due to a race condition where Mantine'''s useClickOutside handler closes the menu on mousedown before the item click handler can execute.

Root Cause

In the Mantine Menu component, when a user clicks on a Menu.Item, the useClickOutside hook fires on mousedown and closes the dropdown before the item'''s onClick handler fires. On most systems this race condition does not manifest, but on some (like Windows 11 LTSC), the event ordering causes the click handler to never execute.

Solution

Close the context menu explicitly in the onClick handler BEFORE calling the action handler. This ensures proper event ordering on all systems.

Changes

  • File: chainforge/react-server/src/BaseNode.tsx
  • Fixed Duplicate Node, Favorite Node, and Delete Node menu items to close the context menu before executing their actions

Testing

  • Manual testing confirmed duplicate/delete/favorite actions work on all systems
  • Verified keyboard navigation still works correctly

Ernest added 2 commits May 31, 2026 14:21
Replace deprecated api-inference.huggingface.co/models/ endpoint with
api-inference.huggingface.co/inference-endpoint/ to resolve 410 Gone errors.
The right-click Duplicate Node action failed on some systems (e.g., Windows 11 LTSC)
due to a race condition where Mantine's useClickOutside handler would close the menu
on mousedown before the item click handler could execute.

The fix closes the context menu explicitly in the onClick handler BEFORE calling
the action handler. This ensures proper event ordering on all systems.

Also applied the same fix to 'Favorite Node' and 'Delete Node' menu items for consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right-click “Duplicate Node” does nothing on v0.3.6.3 and v0.3.6.4 (also reproducible on the hosted web demo)

1 participant