From 2fa724110a25877dff97c8fd5a45c36d5e388b48 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Tue, 20 Aug 2024 21:37:23 +0200 Subject: [PATCH] Check if range method exists on element before executing it (#11873) Co-authored-by: Jacco van den Berg --- src/core/core.interaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.interaction.js b/src/core/core.interaction.js index fc5aac83d38..c35f8d1ae08 100644 --- a/src/core/core.interaction.js +++ b/src/core/core.interaction.js @@ -211,7 +211,7 @@ function getAxisItems(chart, position, axis, intersect, useFinalPosition) { let intersectsItem = false; evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => { - if (element[rangeMethod](position[axis], useFinalPosition)) { + if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) { items.push({element, datasetIndex, index}); intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition); }