From 8088f86f7aafdcdd9ce4e8168711f4a2f4435685 Mon Sep 17 00:00:00 2001 From: Mark Silverwood <3482679+SlicedSilver@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:36:11 +0000 Subject: [PATCH 1/2] fix hoveredSeries undefined during series removal and creation --- .size-limit.js | 8 ++++---- src/api/chart-api.ts | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.size-limit.js b/.size-limit.js index bac32267f4..a03a28ab42 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -4,21 +4,21 @@ module.exports = [ { name: 'CJS', path: 'dist/lightweight-charts.production.cjs', - limit: '47.98 KB', + limit: '48.08 KB', }, { name: 'ESM', path: 'dist/lightweight-charts.production.mjs', - limit: '47.91 KB', + limit: '48.02 KB', }, { name: 'Standalone-ESM', path: 'dist/lightweight-charts.standalone.production.mjs', - limit: '49.63 KB', + limit: '49.72 KB', }, { name: 'Standalone', path: 'dist/lightweight-charts.standalone.production.js', - limit: '49.67 KB', + limit: '49.77 KB', }, ]; diff --git a/src/api/chart-api.ts b/src/api/chart-api.ts index d6cab67970..cb09ce6f6e 100644 --- a/src/api/chart-api.ts +++ b/src/api/chart-api.ts @@ -390,7 +390,11 @@ export class ChartApi implements IChartApiBase, Da seriesData.set(this._mapSeriesToApi(series), data); }); - const hoveredSeries = param.hoveredSeries === undefined ? undefined : this._mapSeriesToApi(param.hoveredSeries); + const hoveredSeries = + param.hoveredSeries === undefined || + !this._seriesMapReversed.has(param.hoveredSeries) + ? undefined + : this._mapSeriesToApi(param.hoveredSeries); return { time: param.originalTime as HorzScaleItem, From bead8cfed830c0dc500b67e75932b3f4ee69f7c5 Mon Sep 17 00:00:00 2001 From: Mark Silverwood <3482679+SlicedSilver@users.noreply.github.com> Date: Wed, 8 May 2024 16:50:27 +0100 Subject: [PATCH 2/2] update size-limit --- .size-limit.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.size-limit.js b/.size-limit.js index 61db7a1c6a..e517fb80a0 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -4,21 +4,21 @@ module.exports = [ { name: 'CJS', path: 'dist/lightweight-charts.production.cjs', - limit: '48.16 KB', + limit: '48.17 KB', }, { name: 'ESM', path: 'dist/lightweight-charts.production.mjs', - limit: '48.09 KB', + limit: '48.10 KB', }, { name: 'Standalone-ESM', path: 'dist/lightweight-charts.standalone.production.mjs', - limit: '49.79 KB', + limit: '49.80 KB', }, { name: 'Standalone', path: 'dist/lightweight-charts.standalone.production.js', - limit: '49.83 KB', + limit: '49.84 KB', }, ];