plotly / react-plotly.js

A plotly.js React component from Plotly 📈
MIT License
1.01k stars 135 forks source link

onMouseLeave not getting called #318

Open soichih opened 1 year ago

soichih commented 1 year ago

Hello. I am trying to capture onMouseLeave event when a user move a mouse cursor out of the Plot.

<Plot onMouseLeave={()=>{console.log("good bye!")}}/>

onMouseLeave event seems to be ignored by this component. Is this expected? Is there another way to capture this event?

soichih commented 1 year ago

This seems to work.


<div onMouseLeave={()=>{console.log("good bye!")}}>
    <Plot/>
</div>

I just realized, however, that what I really need is an event handler when a user leaves the "plot" area - not the whole "paper". I want something similar to onMouseLeave handler getting called when a user navigates away from the Plotly plots inside the paper area.