Skip to content

Commit

Permalink
chore: remove unused pointer event
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Dec 11, 2023
1 parent 7503b16 commit f1ac0f8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/interaction/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ export function seriesTooltip(
) as (...args: any[]) => void;

const hide = (event: MouseEvent) => {
console.log(111, 'hide');
hideTooltip({ root, single, emitter, event });
if (crosshairs) hideRuleY(root);
if (marker) hideMarker(root);
Expand Down Expand Up @@ -853,23 +852,21 @@ export function tooltip(
) as (...args: any[]) => void;

const pointerleave = (event) => {
// const { target: element } = event;
console.log(1112, 'leave');
// if (!elementSet.has(element)) return;
hideTooltip({ root, single, emitter, event });
};

const addEventListeners = () => {
if (!disableNative) {
root.addEventListener('pointerover', pointerover);
console.log(111, 'addEventListeners');
root.addEventListener('pointermove', pointerover);
// Only emit pointerleave event when the pointer is not in the root area.
// !! !DO NOT USE pointerout event, it will emit when the pointer is in the child area.
root.addEventListener('pointerleave', pointerleave);
}
};

const removeEventListeners = () => {
if (!disableNative) {
root.removeEventListener('pointerover', pointerover);
root.removeEventListener('pointermove', pointerover);
root.removeEventListener('pointerleave', pointerleave);
}
Expand Down

0 comments on commit f1ac0f8

Please sign in to comment.