-
-
Notifications
You must be signed in to change notification settings - Fork 830
Fix left positioned tooltips being wrong and offset by fixed value #7551
Changes from all commits
33407c5
c559e90
6c6e246
deb1f30
511849b
ffece09
ee6f3f8
dca8d2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now using a consistent offset from both the left and right. |
||
|
||
background-color: #21262C; // Same on both themes | ||
color: $accent-fg-color; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The v-align is better here but still slightly off, now the tooltip looks a couple px too high There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can change the vertical alignment on this specific tooltip but this probably comes down to the vertical tooltip calculation code which I didn't touch in this PR and also has arbitrary offsets in it. Ideally that code should vertically center things just fine. We can address the vertical problems in another PR because I don't want to keep re-doing the before/after screenshots, etc It's 20px above and below the read receipt now: |
||
// We don't use `position: relative` on the element because then it won't line | ||
// up with the other read receipts | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,8 +117,8 @@ export default class Tooltip extends React.Component<ITooltipProps> { | |
); | ||
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing arbitrary offsets |
||
const right = width - parentBox.left - window.pageXOffset; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
const left = parentBox.right + window.pageXOffset; | ||
const horizontalCenter = ( | ||
parentBox.left - window.pageXOffset + (parentWidth / 2) | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remove the
element-web
reviewer? I don't want to assign for review until ready.Seems to be locked 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why - was this opened as a draft from the start or converted to a draft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was created normally. And I see the system note for converting to draft here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's something to do with the code owner but I don't think I did anything to trigger that (edit: maybe not, seems to be the same on other PRs). Usually it assigns
element-web
but I can remove it.