fix(react/svelte): select nodes on click when nodeDragThreshold > 0

This commit is contained in:
moklick
2023-10-09 15:22:58 +02:00
parent 5313a9bfcc
commit 6f9ebbf609
2 changed files with 6 additions and 5 deletions
@@ -67,8 +67,9 @@ export default (NodeComponent: ComponentType<NodeProps>) => {
const onContextMenuHandler = getMouseHandler(id, store.getState, onContextMenu);
const onDoubleClickHandler = getMouseHandler(id, store.getState, onDoubleClick);
const onSelectNodeHandler = (event: MouseEvent) => {
const { selectNodesOnDrag } = store.getState();
if (isSelectable && (!selectNodesOnDrag || !isDraggable)) {
const { selectNodesOnDrag, nodeDragThreshold } = store.getState();
if (isSelectable && (!selectNodesOnDrag || !isDraggable || nodeDragThreshold > 0)) {
// this handler gets called within the drag start event when selectNodesOnDrag=true
handleNodeClick({
id,