You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tooltip and hover modes should be preserved when reassigning chart options.
Current Behavior
After updating from Chart.js 3.0.0-beta.4 to beta 5, I noticed that my tooltips were no longer working. The problem appears to be the result of #7922; that PR adds logic to configure hover and tooltip options from a common set of interaction options, but that logic is only invoked on chart initialization, not on update. So, depending on how updates to the chart options are performed, the defaulted options can be lost.
(In my case, I'm using a home-grown Chart.js React component to do a wholesale replacement of the chart options object based on whatever options are passed as props to the React component.)
Possible Solution
Chart updates invoke the same interaction-merging logic as chart initialization, or tooltips and hover fall back to interaction when the options are actually used instead of merging interaction when they're initialized.
Steps to Reproduce
See https://codepen.io/joshkel/pen/VwjBwaa. Tooltips and hover work when the chart first loads, but clicking the Update button causes them to stop working.
Environment
Chart.js version: 3.0.0-beta.5
Browser name and version: Chrome 86.0.4240.183
The text was updated successfully, but these errors were encountered:
Expected Behavior
Tooltip and hover modes should be preserved when reassigning chart options.
Current Behavior
After updating from Chart.js 3.0.0-beta.4 to beta 5, I noticed that my tooltips were no longer working. The problem appears to be the result of #7922; that PR adds logic to configure hover and tooltip options from a common set of
interaction
options, but that logic is only invoked on chart initialization, not on update. So, depending on how updates to the chart options are performed, the defaulted options can be lost.(In my case, I'm using a home-grown Chart.js React component to do a wholesale replacement of the chart
options
object based on whatever options are passed as props to the React component.)Possible Solution
Chart updates invoke the same
interaction
-merging logic as chart initialization, or tooltips and hover fall back tointeraction
when the options are actually used instead of merginginteraction
when they're initialized.Steps to Reproduce
See https://codepen.io/joshkel/pen/VwjBwaa. Tooltips and hover work when the chart first loads, but clicking the Update button causes them to stop working.
Environment
The text was updated successfully, but these errors were encountered: