From 721db0d9f212ca45e8fe9585be6fe73fdcb407ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szumi=C5=84ski?= Date: Thu, 1 Jun 2023 11:13:22 +0200 Subject: [PATCH] Fixed #19053, item series update issue. --- ts/Series/Item/ItemSeries.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ts/Series/Item/ItemSeries.ts b/ts/Series/Item/ItemSeries.ts index f77b6aeb05b..64ac3010c36 100644 --- a/ts/Series/Item/ItemSeries.ts +++ b/ts/Series/Item/ItemSeries.ts @@ -345,18 +345,21 @@ class ItemSeries extends PieSeries { i++; } } - graphics.forEach((graphic, i): void => { + + for (let j = 0; j < graphics.length; j++) { + const graphic = graphics[j]; if (!graphic) { return; } if (!graphic.isActive) { graphic.destroy(); - graphics.splice(i, 1); + graphics.splice(j, 1); + j--; // Need to substract 1 after splice, #19053 } else { graphic.isActive = false; } - }); + } }); }