Skip to content

Commit

Permalink
Position comment preview on bottom left of indicator (#4701)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruggi authored Jan 8, 2024
1 parent af46cd5 commit 591eba2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion editor/src/components/canvas/controls/comment-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ const HoveredCommentIndicator = React.memo((props: HoveredCommentIndicatorProps)
cancelHover,
])

const canvasDiv = document.getElementById('canvas-root')

const canvasHeight = canvasDiv?.clientHeight ?? 0

const collabs = useStorage((storage) => storage.collaborators)
if (hidden && dragPosition == null) {
return null
Expand All @@ -443,7 +447,7 @@ const HoveredCommentIndicator = React.memo((props: HoveredCommentIndicatorProps)
background: colorTheme.bg1.value,
zIndex: 1,
position: 'fixed',
top: position.y,
bottom: canvasHeight - IndicatorSize - position.y,
// temporarily moving the hovered comment indicator to align with the not hovered version
left: position.x - 3,
overflow: 'hidden',
Expand Down

0 comments on commit 591eba2

Please sign in to comment.