Skip to content

Commit

Permalink
Check if range method exists on element before executing it (#11873)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacco van den Berg <[email protected]>
  • Loading branch information
LeeLenaleee and Jacco van den Berg authored Aug 20, 2024
1 parent a1f7355 commit 2fa7241
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/core.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2fa7241

Please sign in to comment.