From c948782c18b013a340de75431435e4b413519eea Mon Sep 17 00:00:00 2001 From: Ritik Bora Date: Thu, 10 Oct 2024 13:44:22 +0530 Subject: [PATCH] tooltip_flickering_fix --- packages/core/src/components/Tooltip/Tooltip.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/src/components/Tooltip/Tooltip.tsx b/packages/core/src/components/Tooltip/Tooltip.tsx index 29bcbc84f8..8fdddf1fc1 100644 --- a/packages/core/src/components/Tooltip/Tooltip.tsx +++ b/packages/core/src/components/Tooltip/Tooltip.tsx @@ -318,6 +318,7 @@ export default class Tooltip extends PureComponent { tip, arrowClassName, id, + position, "data-testid": dataTestId } = this.props; @@ -329,9 +330,16 @@ export default class Tooltip extends PureComponent { return this.renderTooltipContent(); } + let moveAmount : MoveBy = this.props.moveBy; + + if (position && (position.includes("top") || position.includes("bottom"))) { + moveAmount = { main: 11, secondary: 0 }; + } + const content = this.renderTooltipContent; const dialogProps = { ...this.props, + moveBy: moveAmount, "data-testid": dataTestId || getTestId(ComponentDefaultTestId.TOOLTIP, id), startingEdge: justify, tooltip: tip,