Skip to content

Commit

Permalink
fix(DFD-914): Fix flashing tooltip on some gesture (#5239)
Browse files Browse the repository at this point in the history
  • Loading branch information
aamalric-talend authored Mar 26, 2024
1 parent 246da0c commit 377e43a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-balloons-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@talend/design-system": patch
---

fix(DFD-914): Fix flashing tooltip on some gesture
21 changes: 11 additions & 10 deletions packages/design-system/src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useState, useRef } from 'react';
import type { MutableRefObject, RefCallback, ReactElement, ReactNode } from 'react';
import { useRef, useState } from 'react';
import type { MutableRefObject, ReactElement, ReactNode, RefCallback } from 'react';

import {
arrow,
autoUpdate,
flip,
FloatingArrow,
FloatingPortal,
offset,
safePolygon,
shift,
useDismiss,
useFloating,
useHover,
useFocus,
useDismiss,
useRole,
useHover,
useInteractions,
autoUpdate,
flip,
offset,
shift,
useRole,
} from '@floating-ui/react';

import { ChildOrGenerator, renderOrClone } from '../../renderOrClone';
Expand Down Expand Up @@ -79,7 +80,7 @@ export const Tooltip = ({ id, children, title, placement = 'top', ...rest }: Too
],
whileElementsMounted: autoUpdate,
});
const hover = useHover(floating.context, { move: false });
const hover = useHover(floating.context, { move: false, handleClose: safePolygon() });
const focus = useFocus(floating.context);
const dismiss = useDismiss(floating.context);
const role = useRole(floating.context, { role: 'tooltip' });
Expand Down

0 comments on commit 377e43a

Please sign in to comment.