Skip to content

Commit

Permalink
Shrink _parsed to match if dataset shrinks (#6826)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored and etimberg committed Dec 10, 2019
1 parent dc4cff7 commit 6f6005d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/core.datasetController.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ helpers.extend(DatasetController.prototype, {
me.insertElements(numMeta, numData - numMeta);
} else if (numData < numMeta) {
meta.data.splice(numData, numMeta - numData);
meta._parsed.splice(numData, numMeta - numData);
me._parse(0, numData);
} else if (changed) {
me._parse(0, numData);
Expand Down
1 change: 1 addition & 0 deletions test/specs/controller.bar.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ describe('Chart.controllers.bar', function() {
chart.update();

expect(meta.data.length).toBe(2);
expect(meta._parsed.length).toBe(2);

[
{x: 89, y: 512},
Expand Down
2 changes: 1 addition & 1 deletion test/specs/controller.line.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('Chart.controllers.line', function() {
chart.update();

expect(meta.data.length).toBe(2);

expect(meta._parsed.length).toBe(2);

[
{x: 0, y: 512},
Expand Down

0 comments on commit 6f6005d

Please sign in to comment.