Skip to content

Commit 13bf93b

Browse files
authoredMar 7, 2023
fix(topology): Allow tooltip customization on TaskNode (#8782)

File tree

1 file changed

+5
-1
lines changed
  • packages/react-topology/src/pipelines/components/nodes

1 file changed

+5
-1
lines changed
 

‎packages/react-topology/src/pipelines/components/nodes/TaskNode.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
import { TooltipProps } from '@patternfly/react-core';
23
import { css } from '@patternfly/react-styles';
34
import styles from '@patternfly/react-styles/css/components/Topology/topology-pipelines';
45
import topologyStyles from '@patternfly/react-styles/css/components/Topology/topology-components';
@@ -85,6 +86,8 @@ export interface TaskNodeProps {
8586
disableTooltip?: boolean;
8687
/** Tooltip to show on node hover */
8788
toolTip?: React.ReactNode;
89+
/** Tooltip properties to pass along to the node's tooltip */
90+
toolTipProps?: Omit<TooltipProps, 'content'>;
8891
/** Flag if the node has a 'when expression' */
8992
hasWhenExpression?: boolean;
9093
/** Size of the when expression indicator */
@@ -134,6 +137,7 @@ export const TaskNode: React.FC<TaskNodeProps> = ({
134137
hover,
135138
truncateLength = 14,
136139
toolTip,
140+
toolTipProps,
137141
disableTooltip = false,
138142
selected,
139143
onSelect,
@@ -475,7 +479,7 @@ export const TaskNode: React.FC<TaskNodeProps> = ({
475479
{!toolTip || disableTooltip ? (
476480
renderTask()
477481
) : (
478-
<Tooltip position="bottom" enableFlip={false} content={toolTip}>
482+
<Tooltip position="bottom" enableFlip={false} {...(toolTipProps ?? {})} content={toolTip}>
479483
{renderTask()}
480484
</Tooltip>
481485
)}

0 commit comments

Comments
 (0)
Please sign in to comment.