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

Uncaught (in promise) TypeError: Cannot read property '__eventTarget' of null #4

Closed
haleksandre opened this issue Apr 7, 2016 · 3 comments
Labels

Comments

@haleksandre
Copy link

When using some type of charts such as GeoChart, the events implementation is throwing the following error:

Uncaught (in promise) TypeError: Cannot read property '__eventTarget' of null

After troubleshooting, it seems that when the chart type is GeoChart the component's data chart doesn't get set before the eventsBinder(self, self.chart, self.chartEvents) gets called.

@haleksandre
Copy link
Author

google.visualization.events.addOneTimeListener(self.wrapper, 'ready', function () {
     self.chart = self.wrapper.getChart();
});

It seems with GeoChart this listener gets trigger after the Promise is fufilled, but is fine with BarChart... Haven't tested other charts yet.

@haydenbbickerton
Copy link
Owner

Thanks for finding and debugging this! Just pushed a fix that should take care of this. Now it waits to bind events until the chart promise is resolved.

@rzb
Copy link

rzb commented Mar 31, 2017

I'm getting the same error when binding a "select" event to a bar chart (material). I haven't tracked it down, but my first thought was that it might have something to do with loading data from remote? There's nothing to select when the component is mounted in this case.

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

No branches or pull requests

3 participants