Reworked Node Dragging Behavior
This commit is contained in:
parent
38f564347b
commit
8a4b9ebb05
@ -94,6 +94,21 @@ label {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
/* Node Header - Shows drag handle cursor */
|
||||
.borealis-node-header {
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
/* Optional: when actively dragging */
|
||||
.borealis-node-header:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* Node Body - Just pointer, not draggable */
|
||||
.borealis-node-content {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* ======================================= */
|
||||
/* FLOW TABS */
|
||||
/* ======================================= */
|
||||
|
@ -65,7 +65,16 @@ export default function FlowEditor({
|
||||
const position = project({ x: event.clientX - bounds.left, y: event.clientY - bounds.top });
|
||||
const id = "node-" + Date.now();
|
||||
const nodeMeta = Object.values(categorizedNodes).flat().find((n) => n.type === type);
|
||||
const newNode = { id, type, position, data: { label: nodeMeta?.label || type, content: nodeMeta?.content } };
|
||||
const newNode = {
|
||||
id,
|
||||
type,
|
||||
position,
|
||||
data: {
|
||||
label: nodeMeta?.label || type,
|
||||
content: nodeMeta?.content
|
||||
},
|
||||
dragHandle: '.borealis-node-header' // <-- Add this line
|
||||
};
|
||||
setNodes((nds) => [...nds, newNode]);
|
||||
},
|
||||
[project, setNodes, categorizedNodes]
|
||||
|
Loading…
x
Reference in New Issue
Block a user