diff --git a/res/css/views/elements/_Tooltip.scss b/res/css/views/elements/_Tooltip.scss index 7e6b36a2bab..93ee6912b4f 100644 --- a/res/css/views/elements/_Tooltip.scss +++ b/res/css/views/elements/_Tooltip.scss @@ -60,7 +60,8 @@ limitations under the License. font-weight: 500; max-width: 200px; word-break: break-word; - margin-right: 50px; + margin-left: 6px; + margin-right: 6px; background-color: #21262C; // Same on both themes color: $accent-fg-color; diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 87afb4734a4..181a300ef75 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -20,6 +20,10 @@ $left-gutter: 64px; .mx_EventTile { .mx_EventTile_receiptSent, .mx_EventTile_receiptSending { + // Give it some dimensions so the tooltip can position properly + display: inline-block; + width: 14px; + height: 14px; // We don't use `position: relative` on the element because then it won't line // up with the other read receipts diff --git a/src/components/views/elements/Tooltip.tsx b/src/components/views/elements/Tooltip.tsx index 3e20c6c2689..7c37d89127d 100644 --- a/src/components/views/elements/Tooltip.tsx +++ b/src/components/views/elements/Tooltip.tsx @@ -117,8 +117,8 @@ export default class Tooltip extends React.Component { ); const baseTop = (parentBox.top - 2 + this.props.yOffset) + window.pageYOffset; const top = baseTop + offset; - const right = width - parentBox.right - window.pageXOffset - 16; - const left = parentBox.right + window.pageXOffset + 6; + const right = width - parentBox.left - window.pageXOffset; + const left = parentBox.right + window.pageXOffset; const horizontalCenter = ( parentBox.left - window.pageXOffset + (parentWidth / 2) ); diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 4ebe8f2300b..7af5a4b2f03 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -1728,7 +1728,7 @@ class SentReceipt extends React.PureComponent; + tooltip = ; } return ( diff --git a/test/components/views/elements/__snapshots__/TooltipTarget-test.tsx.snap b/test/components/views/elements/__snapshots__/TooltipTarget-test.tsx.snap index cdb12e5af41..9d8516af776 100644 --- a/test/components/views/elements/__snapshots__/TooltipTarget-test.tsx.snap +++ b/test/components/views/elements/__snapshots__/TooltipTarget-test.tsx.snap @@ -3,7 +3,7 @@ exports[` displays tooltip on mouseover 1`] = `