Skip to content

Commit

Permalink
[charts] Prevent invalid releasePointerCapture (#15602)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored Nov 26, 2024
1 parent 37c4d15 commit d20eaca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/x-charts/src/hooks/useInteractionItemProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export const useInteractionItemProps = (skip?: boolean) => {
});
};
const onPointerLeave = (event: React.PointerEvent) => {
event.currentTarget.releasePointerCapture(event.pointerId);
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
event.currentTarget.releasePointerCapture(event.pointerId);
}

store.update((prev) => {
const prevItem = prev.interaction.item;
Expand Down

0 comments on commit d20eaca

Please sign in to comment.