Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions webapp/components/general/TutorialBubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ const TutorialBubble = ({
const windowHeight = window.innerHeight;
const windowWidth = window.innerWidth;

let x = rect1.left + (rect1.width / 2) - (width2 / 2);
let y = (rect1.top - windowHeight) + rect1.height;
// let x = rect1.left + (rect1.width / 2) - (width2 / 2); // bubble is aligned with center of the rectangle
let x = rect1.left; // bubble is aligned with the left of the rectangle
let y = (rect1.top - windowHeight) + rect1.height + rectMargin;

// Check if element2 is outside the viewport horizontally
if (x + width2 > windowWidth) {
x = rect1.left - width2;
// x = rect1.left - width2;
x = rect1.left - ((x + width2) - windowWidth + rectMargin);
}

if (x < 0) {
Expand Down Expand Up @@ -141,7 +143,7 @@ const TutorialBubble = ({
}

const targetRect = DOMtarget.getBoundingClientRect();
const { x, y } = calculateVisiblePosition(targetRect, 150, 300);
const { x, y } = calculateVisiblePosition(targetRect, 400, 184);

const hasOtherSteps = requestedTourStep < steps.length;
const nextIsVisible = nextDOMtarget?.checkVisibility();
Expand Down