From fd315326b4a5d849ffca32655bc3525d801a0367 Mon Sep 17 00:00:00 2001 From: Chris Amow Date: Fri, 28 Aug 2026 15:20:32 -0500 Subject: [PATCH] Stop chart pointerdown from eating Duplicate on the context menu. The menu sits inside the chart element, so pointerdown bubbled into pan/tool capture and the Duplicate click never ran. --- static/chart.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/chart.js b/static/chart.js index 0913190..b428759 100644 --- a/static/chart.js +++ b/static/chart.js @@ -567,7 +567,8 @@ class ConfluenceChart { duplicate.type = 'button'; duplicate.dataset.action = 'duplicate'; duplicate.textContent = 'Duplicate'; - duplicate.addEventListener('click', event => { + duplicate.addEventListener('pointerdown', event => { + event.preventDefault(); event.stopPropagation(); const id = this.contextLineId || this.selectedLineId; const level = this.levels.find(value => value.id === id); @@ -584,6 +585,7 @@ class ConfluenceChart { this.hideContextMenu(); if (id && this.onLineDelete) this.onLineDelete(id); }); + this.contextMenu.addEventListener('pointerdown', event => event.stopPropagation()); this.contextMenu.addEventListener('click', event => event.stopPropagation()); this.contextMenu.append(endHere, extend, duplicate, deleteLine); this.overlayLayer.appendChild(this.contextMenu);