Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Destroy chart in setTimeout() - Uncaught TypeError #5427
Create a chart with custom menu item in the context (hamburger) menu.
Destroys the chart, but throws an error in the console:
Uncaught TypeError: button.setState is not a function hide @ exporting.src.js:546
After debugging, I saw that hide() is called two times - both on click and mouseleave, but the second call is after 500ms. The hide() function hides the menu and changes the button state.
Live demo with steps to reproduce
Google Chrome, Version 51.0.2704.84 m
Tested on different environments:
It seems that error is visible on Windows OS, but not on OSX.
Tested on Windows 7 / Chrome. mouseleave event fires hide after 500 milliseconds, when chart is already destroyed.