Skip to content

Commit

Permalink
RG-2490 support moving cursor from anchor to tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-skl committed Sep 23, 2024
1 parent f66aa7f commit 09dacab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ export default class Tooltip extends Component<TooltipProps> {
addListeners() {
if (this.containerNode != null) {
this.listeners.add(this.containerNode, 'mouseover', this.tryToShowPopup);
this.listeners.add(this.containerNode, 'mouseout', this.hidePopup);
this.listeners.add(this.containerNode, 'mouseout', ev => {
if ('toElement' in ev && this.popup?.container?.contains(ev.toElement as Node)) {
this.listeners.add(this.popup?.container, 'mouseout', this.hidePopup);
return;
}

this.hidePopup();
});
}
this.listeners.add(document, 'scroll', () => scheduleScroll(this.hidePopup), {passive: true});
}
Expand Down

0 comments on commit 09dacab

Please sign in to comment.