Skip to content

Commit

Permalink
Fix tooltip (primefaces#4754)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Aug 9, 2023
1 parent dc53e69 commit 9dbd6b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions components/lib/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import PrimeReact, { PrimeReactContext } from '../api/Api';
import { useHandleStyle } from '../componentbase/ComponentBase';
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 { useHandleStyle } from '../componentbase/ComponentBase';

export const Tooltip = React.memo(
React.forwardRef((inProps, ref) => {
Expand Down Expand Up @@ -404,8 +404,6 @@ export const Tooltip = React.memo(
};

useMountEffect(() => {
loadTargetEvents();

if (visibleState && currentTargetRef.current && isDisabled(currentTargetRef.current)) {
hide();
}
Expand Down Expand Up @@ -505,7 +503,9 @@ export const Tooltip = React.memo(
return (
<div ref={elementRef} {...rootProps}>
<div {...arrowProps}></div>
<div ref={textRef} {...textProps}>{empty && props.children}</div>
<div ref={textRef} {...textProps}>
{empty && props.children}
</div>
</div>
);
};
Expand Down
15 changes: 8 additions & 7 deletions components/lib/tooltip/TooltipBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { ComponentBase } from '../componentbase/ComponentBase';
import { classNames } from '../utils/Utils';

const classes = {
root: ({ positionState, classNameState}) => classNames(
'p-tooltip p-component',
{
[`p-tooltip-${positionState}`]: true
},
classNameState
),
root: ({ positionState, classNameState }) =>
classNames(
'p-tooltip p-component',
{
[`p-tooltip-${positionState}`]: true
},
classNameState
),
arrow: 'p-tooltip-arrow',
text: 'p-tooltip-text'
};
Expand Down

0 comments on commit 9dbd6b4

Please sign in to comment.