plotly / react-plotly.js

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

Plotly.restyle breaks onClick handlers #330

Open sterlingwalsh opened 10 months ago

sterlingwalsh commented 10 months ago

Issue: After calling Plotly.restyle on a rendered chart, onClick callback fail to be called.

Reproduction: https://codesandbox.io/s/youthful-ganguly-kt5pq7?file=/src/chart.tsx Using this example, you are able to click the line points or the bar and see the selection updated at the bottom. this works indefinitely, and as expected. By clicking the restyle button, the bars will change color from orange to blue. After this, click events cease to work on both the bar and the line plots.

Base Plotly: this DOES work as expected in base plotly using the same data and same reproduction steps https://codepen.io/swalsh81/pen/gOqaxeP

Expected functionality: Click events should continue to work after a Plotly.restyle event is called and function like the base plotly does as demonstrated