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

Bug: Avoid updating Chart when responsive: true and Chart is hidden. #5172

Merged
merged 2 commits into from May 23, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/core/core.controller.js
Expand Up @@ -192,6 +192,10 @@ module.exports = function(Chart) {

helpers.retinaScale(me, options.devicePixelRatio);

if (newWidth === 0 || newHeight === 0) {
Copy link
Contributor

@benmccann benmccann Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could combine this if statement with the previous one. e.g. make this check if (silent || newWidth === 0 || newHeight === 0) { and then remove the next if statement

Copy link
Contributor

@benmccann benmccann Jan 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're touching code in this area maybe you can also fix the typo collased a few lines above? I think that comment might also explain why some tests check for width/height of 0

return;
}

if (!silent) {
// Notify any plugins about the resize
var newSize = {width: newWidth, height: newHeight};
Expand Down