From 6f6005d7b87f26d97e3fed86082b8c5b8def5d49 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 10 Dec 2019 15:57:21 -0800 Subject: [PATCH] Shrink _parsed to match if dataset shrinks (#6826) --- src/core/core.datasetController.js | 1 + test/specs/controller.bar.tests.js | 1 + test/specs/controller.line.tests.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 73658bb06b0..30921ef1361 100644 --- a/src/core/core.datasetController.js +++ b/src/core/core.datasetController.js @@ -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); diff --git a/test/specs/controller.bar.tests.js b/test/specs/controller.bar.tests.js index e0894dbc579..76314b46367 100644 --- a/test/specs/controller.bar.tests.js +++ b/test/specs/controller.bar.tests.js @@ -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}, diff --git a/test/specs/controller.line.tests.js b/test/specs/controller.line.tests.js index 51c6928e232..61248398dd9 100644 --- a/test/specs/controller.line.tests.js +++ b/test/specs/controller.line.tests.js @@ -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},