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

Regression Bug: onNodeMouseEnter and onNodeMouseLeave fire more than once since 11.10.0, but was okay in 11.9.4 #4265

Closed simonharrer closed 1 month ago

simonharrer commented 1 month ago

Describe the Bug

Regression Bug: onNodeMouseEnter and onNodeMouseLeave fire more than once since 11.10.0, but was okay in 11.9.4

<ReactFlow
          onNodeMouseEnter={
            (event, node) => {
              console.log('onNodeMouseEnter', event, node);
            }
          }
          onNodeMouseLeave={
            (event, node) => {
              console.log('onNodeMouseLeave', event, node);
            }
          }

This should fire only once when hovering over a node. Since 11.10.0 it fires multiple times.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Register onNodeMouseEnter listener.
  2. Register onNodeMouseLeave listener.
  3. Hover over it.
  4. Should fire the enter/leave events as one would expect, but not more.

Expected behavior

Fire event once.

Screenshots or Videos

No response

Platform

Additional context

No response

bcakmakoglu commented 1 month ago

Can you provide a repro for this issue? Trying to reproduce this in a fresh sandbox and it seems to work fine:

https://github.com/xyflow/xyflow/assets/78412429/52802114-1f8e-4ee9-a9e8-dd120a61b955

moklick commented 1 month ago

I can't reproduce this either. Please re-open with a codesandbox if the issue persists: https://new.reactflow.dev