xyflow / xyflow

React Flow | Svelte Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev) or Svelte (https://svelteflow.dev). Ready out-of-the-box and infinitely customizable.
https://xyflow.com
MIT License
22.07k stars 1.46k forks source link

Can't use onDoubleClick on ReactFlow component #4169

Closed MetaCorp closed 2 weeks ago

MetaCorp commented 2 months ago

Describe the Bug

I want to add a node when the user double click the page. I tried using onDoubleClick on ReactFlow component, but the function never gets called.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Add onDoubleClick event callback to ReactFlow component

Expected behavior

When the user double click the Flow, the callback is called.

Screenshots or Videos

No response

Platform

Additional context

No response

peterkogo commented 2 weeks ago

You have to set zoomOnDoubleClick={false} on the ReactFlow component for this to work.