Fix React Flow node dragging - nodes not reactive to cursor and position updates #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the React Flow node dragging issues where nodes were not responsive to cursor movement and positions were not updating consistently during drag operations.
Problem
The React Flow setup had several issues causing poor dragging behavior:
change.dragging === false
, causing nodes to not follow the cursor during drag operations.drag-handle
class (only the header area)Solution
Key Changes
MainCanvas.tsx:
change.dragging === false
condition inhandleNodesChange
to enable real-time position updates during draggingdragHandle: '.drag-handle'
restriction to make the entire node draggableStructNode.tsx:
cursor-move
styling to the entire Card component to clearly indicate draggabilitycursor-move
from the header-only drag handleBefore vs After
Before:
After:
Testing
Verified that both User and Profile struct nodes are now:
The screenshot shows the application with draggable struct nodes where the Profile node has been successfully moved to position (77, 20) as shown in the Node Properties panel.
Impact
This fix resolves the core usability issue where users couldn't effectively drag and position struct nodes in the visual mapping interface, which is essential for creating clear and organized struct mapping diagrams.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.