Skip to content

Commit

Permalink
Merge pull request #71 from solved-ac/feature/override-open
Browse files Browse the repository at this point in the history
feat: keep tooltip open
  • Loading branch information
shiftpsh authored Dec 4, 2023
2 parents 92e4690 + cfabe00 commit fb2c0d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export type TooltipProps = {
theme?: SolvedTheme
children?: ReactNode
arrow?: boolean
keepOpen?: boolean
open?: boolean
place?: TooltipPlacement
interactive?: boolean
activateOnHover?: boolean
Expand Down Expand Up @@ -126,7 +126,7 @@ export const Tooltip: React.FC<TooltipProps> = (props) => {
noDefaultStyles: noBackground,
children,
arrow: drawArrow = true,
keepOpen = false,
open,
place,
interactive = false,
activateOnHover = true,
Expand All @@ -136,7 +136,7 @@ export const Tooltip: React.FC<TooltipProps> = (props) => {
...cardProps
} = props
const [isOpen, setIsOpen] = useState(false)
const renderTooltip = keepOpen || isOpen
const renderTooltip = typeof open === 'boolean' ? open : isOpen

const arrowRef = useRef(null)

Expand Down Expand Up @@ -178,7 +178,7 @@ export const Tooltip: React.FC<TooltipProps> = (props) => {
enabled: activateOnClick,
}),
useDismiss(context, {
enabled: activateOnClick && !keepOpen,
enabled: activateOnClick,
}),
])

Expand Down

0 comments on commit fb2c0d8

Please sign in to comment.