Skip to content

Commit

Permalink
Fix primefaces#4604: Tooltip autohide fix
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jul 3, 2023
1 parent 03d3b26 commit 6e1407f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions components/doc/tooltip/autohidedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function AutoHideDoc(props) {

const code = {
basic: `
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" />
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" tooltipOptions={{ position: 'left' }} />
<Tooltip target=".tooltip-button" autoHide={false}>
<div className="flex align-items-center">
Expand All @@ -30,7 +30,7 @@ export default function AutoHideDemo() {
return (
<div className="card flex flex-wrap align-items-center justify-content-center gap-2">
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" />
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" tooltipOptions={{ position: 'left' }} />
<Tooltip target=".tooltip-button" autoHide={false}>
<div className="flex align-items-center">
Expand All @@ -54,7 +54,7 @@ export default function AutoHideDemo() {
return (
<div className="card flex flex-wrap align-items-center justify-content-center gap-2">
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" />
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" tooltipOptions={{ position: 'left' }} />
<Tooltip target=".tooltip-button" autoHide={false}>
<div className="flex align-items-center">
Expand All @@ -78,7 +78,7 @@ export default function AutoHideDemo() {
</p>
</DocSectionText>
<div className="card flex flex-wrap align-items-center justify-content-center gap-2">
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" />
<Button type="button" label="Save" icon="pi pi-check" tooltip="Save (autoHide: true)" tooltipOptions={{ position: 'left' }} />

<Tooltip target=".tooltip-button" autoHide={false}>
<div className="flex align-items-center">
Expand Down
5 changes: 2 additions & 3 deletions components/lib/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as React from 'react';
import { PrimeReactContext } from '../api/Api';
import PrimeReact, { PrimeReactContext } from '../api/Api';
import { useMountEffect, useOverlayScrollListener, useResizeListener, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks';
import { Portal } from '../portal/Portal';
import { DomHandler, ObjectUtils, ZIndexUtils, classNames, mergeProps } from '../utils/Utils';
import { TooltipBase } from './TooltipBase';
import PrimeReact from '../api/Api';

export const Tooltip = React.memo(
React.forwardRef((inProps, ref) => {
Expand Down Expand Up @@ -489,7 +488,7 @@ export const Tooltip = React.memo(
role: 'tooltip',
'aria-hidden': visibleState,
onMouseEnter: (e) => onMouseEnter(e),
onMouseLeave: (e) => onMouseLeave
onMouseLeave: (e) => onMouseLeave(e)
},
TooltipBase.getOtherProps(props),
ptm('root')
Expand Down

0 comments on commit 6e1407f

Please sign in to comment.