Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit b447988

Browse files
committed
fix(formula): fixes edge cases for positioning tooltip
Signed-off-by: Diana Lease <[email protected]>
1 parent 7d27cf7 commit b447988

File tree

1 file changed

+4
-5
lines changed
  • packages/ui-contract-editor/src/lib/components/Formula

1 file changed

+4
-5
lines changed

packages/ui-contract-editor/src/lib/components/Formula/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ import { FORMULA } from '../../ContractEditor/plugins/withClauseSchema';
88

99
// overflow-wrap: break-word; // NEEDS TO BE NONE
1010
export const FormulaTooltip = styled.span`
11+
z-index: 2;
1112
visibility: ${props => (props.currentHover ? 'visible' : 'hidden')};
12-
margin-top: -${props => (props.tooltipHeight + 1.35)}em;
13+
transform: translateY(-110%);
1314
white-space: normal;
1415
1516
&:before {
1617
content: '';
1718
position: absolute;
1819
bottom: -6.7px;
19-
left: ${props => props.caretLeft - 1}px;
20+
left: 1px;
2021
border-top: 6px solid #141F3C;
2122
border-left: 6px solid transparent;
2223
border-right: 6px solid transparent;
@@ -26,7 +27,7 @@ export const FormulaTooltip = styled.span`
2627
content: '';
2728
position: absolute;
2829
bottom: -6.7px;
29-
left: ${props => props.caretLeft}px;
30+
left: 2px;
3031
border-top: 4px solid #141F3C;
3132
border-left: 4px solid transparent;
3233
border-right: 4px solid transparent;
@@ -77,8 +78,6 @@ const Formula = React.forwardRef((props, ref) => {
7778
const formulaTooltip = {
7879
className: 'variableTooltip',
7980
currentHover: hoveringFormula,
80-
caretLeft: 2,
81-
tooltipHeight: 1.85,
8281
contentEditable: false
8382
};
8483

0 commit comments

Comments
 (0)