Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-92683 || change default delay #29

Merged
merged 2 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const Bar: FC<BarProps> = ({
<div className={cx('page-number')}>{section.pages.from}</div>
</div>
}
className={cx('tooltip-wrapper')}
wrapperClassName={cx('tooltip-wrapper')}
placement={'top'}
>
<div
Expand Down
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
Loading