mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
fix(ui): tooltip stays open on hover [EE-3445] (#8051)
This commit is contained in:
parent
c173888b64
commit
cbaba43842
15 changed files with 191 additions and 177 deletions
|
@ -1,11 +1,6 @@
|
|||
import ReactTooltip from 'react-tooltip';
|
||||
import { HelpCircle } from 'lucide-react';
|
||||
import clsx from 'clsx';
|
||||
import _ from 'lodash';
|
||||
|
||||
import styles from './Tooltip.module.css';
|
||||
|
||||
type Position = 'top' | 'right' | 'bottom' | 'left';
|
||||
import { TooltipWithChildren, Position } from '../TooltipWithChildren';
|
||||
|
||||
export interface Props {
|
||||
position?: Position;
|
||||
|
@ -14,24 +9,15 @@ export interface Props {
|
|||
}
|
||||
|
||||
export function Tooltip({ message, position = 'bottom', className }: Props) {
|
||||
const id = _.uniqueId('tooltip-');
|
||||
|
||||
return (
|
||||
<span
|
||||
data-tip={message}
|
||||
data-for={id}
|
||||
className={clsx(styles.icon, 'inline-flex text-base')}
|
||||
<TooltipWithChildren
|
||||
message={message}
|
||||
position={position}
|
||||
className={className}
|
||||
>
|
||||
<HelpCircle className="lucide" aria-hidden="true" />
|
||||
<ReactTooltip
|
||||
id={id}
|
||||
multiline
|
||||
type="info"
|
||||
place={position}
|
||||
effect="solid"
|
||||
className={clsx(styles.tooltip, className)}
|
||||
arrowColor="transparent"
|
||||
/>
|
||||
</span>
|
||||
<span className="inline-flex text-base">
|
||||
<HelpCircle className="lucide ml-1" aria-hidden="true" />
|
||||
</span>
|
||||
</TooltipWithChildren>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue