From 073cb67d7297ebf65d020ab3d9ed0df8106a4764 Mon Sep 17 00:00:00 2001 From: Gary Date: Tue, 20 Oct 2026 21:13:58 +0200 Subject: [PATCH] fix(stats): the mouse wheel scrolls the page instead of zooming a chart --- src/components/Stats/StatsChart.spec.js | 2 ++ src/components/Stats/StatsChart.vue | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Stats/StatsChart.spec.js b/src/components/Stats/StatsChart.spec.js index 97f9d875..946cb40b 100644 --- a/src/components/Stats/StatsChart.spec.js +++ b/src/components/Stats/StatsChart.spec.js @@ -102,6 +102,8 @@ describe('the chart card', () => { zoomed({}, { xaxis: { min: Number.NaN, max: 2000 } }) expect(wrapper.emitted('zoom')).toEqual([[{ min: 1000, max: 2000 }]]) expect(apex().props('options').chart.zoom).toMatchObject({ enabled: true, type: 'x', autoSelected: 'zoom' }) + // the wheel must keep scrolling the page + expect(apex().props('options').chart.zoom.allowMouseWheelZoom).toBe(false) }) it('applies the zoom window of the page to the x axis', async () => { diff --git a/src/components/Stats/StatsChart.vue b/src/components/Stats/StatsChart.vue index 47401712..a6243529 100644 --- a/src/components/Stats/StatsChart.vue +++ b/src/components/Stats/StatsChart.vue @@ -111,7 +111,7 @@ export default { ...base, chart: { ...base.chart, - zoom: { enabled: true, type: 'x', autoSelected: 'zoom' }, + zoom: { enabled: true, type: 'x', autoSelected: 'zoom', allowMouseWheelZoom: false }, events: { zoomed: (ctx, config) => { const min = config?.xaxis?.min