Skip to content

Commit

Permalink
EPMRPP-92683 || change default delay
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazarQSO committed Jul 29, 2024
1 parent cca6ff5 commit 22b21bb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import { useFloating, flip, Placement } from '@floating-ui/react-dom';
import styles from './tooltip.module.scss';

const cx = classNames.bind(styles);
const TOOLTIP_DELAY_MS = 2000;
const TOOLTIP_DELAY_MS = 300;
const SAFE_ZONE = 100;

interface TooltipProps {
content: ReactNode;
children: ReactNode;
className?: string;
wrapperClassName?: string;
contentClassName?: string;
dynamicWidth?: boolean;
width?: number;
placement?: Placement;
Expand All @@ -35,7 +36,8 @@ interface TooltipProps {

export const Tooltip: FC<TooltipProps> = ({
content,
className,
wrapperClassName,
contentClassName,
dynamicWidth,
width,
placement = 'bottom',
Expand Down Expand Up @@ -75,7 +77,7 @@ export const Tooltip: FC<TooltipProps> = ({
<>
<div
ref={(node) => refs.setReference(node as HTMLElement)}
className={cx('tooltip-wrapper', className)}
className={cx('tooltip-wrapper', wrapperClassName)}
onMouseDown={handleHideTooltip}
onMouseEnter={handleShowTooltip}
onMouseLeave={handleHideTooltip}
Expand All @@ -93,7 +95,7 @@ export const Tooltip: FC<TooltipProps> = ({
data-automation-id={dataAutomationId}
>
<div
className={cx('tooltip-content')}
className={cx('tooltip-content', contentClassName)}
style={{
maxWidth: `${maxWidth}px`,
}}
Expand Down

0 comments on commit 22b21bb

Please sign in to comment.