Skip to content
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 @@ -20,6 +20,10 @@ export interface TooltipProps extends Omit<Props, 'content' | 'children'> {
children: ReactElement<any>;
/** Tooltip content */
content: ReactElement<any> | string;
/** Delay in ms before a tooltip appears */
entryDelay?: number;
/** Delay in ms before a tooltip disappears */
exitDelay?: number;
/** The element to append the tooltip to, defaults to body */
appendTo?: Element | ((ref: Element) => Element);
/** z-index of the tooltip */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const propTypes = {
content: PropTypes.node.isRequired,
/** The reference element to which the tooltip is relatively placed to */
children: PropTypes.element.isRequired,
/** Delay in ms before the tooltip appears */
entryDelay: PropTypes.number,
/** Delay in ms before the tooltip disappears */
exitDelay: PropTypes.number,
/** The element to append the tooltip to, defaults to body */
appendTo: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
/** z-index of the tooltip */
Expand All @@ -41,6 +45,8 @@ const defaultProps = {
position: 'top',
enableFlip: true,
className: null,
entryDelay: 500,
exitDelay: 500,
appendTo: () => document.body,
zIndex: 9999,
maxWidth: tooltipMaxWidth && tooltipMaxWidth.value
Expand Down Expand Up @@ -72,6 +78,8 @@ class Tooltip extends React.Component {
children,
className,
content: bodyContent,
entryDelay,
exitDelay,
appendTo,
zIndex,
maxWidth,
Expand Down Expand Up @@ -99,6 +107,7 @@ class Tooltip extends React.Component {
theme="pf-tippy"
performance
placement={position}
delay={[entryDelay, exitDelay]}
distance={15}
flip={enableFlip}
popperOptions={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ exports[`tooltip renders 1`] = `
</TooltipContent>
</div>
}
delay={
Array [
500,
500,
]
}
distance={15}
flip={true}
lazy={true}
Expand Down