fix(react/svelte): select nodes on click when nodeDragThreshold > 0
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user