Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With tooltips disabled, TypeError: Cannot read property 'update' of undefined #84

Closed
artus9033 opened this issue Dec 29, 2021 · 2 comments · Fixed by #85
Closed

With tooltips disabled, TypeError: Cannot read property 'update' of undefined #84

artus9033 opened this issue Dec 29, 2021 · 2 comments · Fixed by #85

Comments

@artus9033
Copy link
Owner

There is a bug if the chart is configured to have disabled tooltips (options: { plugins: { tooltip: { enabled: false } } }):

chartjs-plugin-dragdata.js:1531 Uncaught TypeError: Cannot read property 'update' of undefined
    at Object.beforeEvent (chartjs-plugin-dragdata.js:1531)
    at callback (helpers.segment.js:92)
    at PluginService._notify (chart.esm.js:4922)
    at PluginService.notify (chart.esm.js:4909)
    at Chart.notifyPlugins (chart.esm.js:6047)
    at Chart._eventHandler (chart.esm.js:6069)
    at Chart.update (chart.esm.js:5641)
    at updateData (chartjs-plugin-dragdata.js:1476)
    at HTMLCanvasElement.<anonymous> (chartjs-plugin-dragdata.js:1524)
    at Dispatch.call (chartjs-plugin-dragdata.js:63)```

It seems like the call there does not check whether `chart.tooltip` is nullish.
@chrispahm
Copy link
Collaborator

Good find @artus9033! Issues like this one constantly remind me of why I need to work on #40...
Also thanks for the PR, will merge ASAP

chrispahm added a commit that referenced this issue Dec 30, 2021
fixes #84 by checking if chart.tooltip is non-nullish in beforeEvent
@chrispahm
Copy link
Collaborator

Published in 2.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants