Skip to content

Commit fc51c7b

Browse files
committed
fix: use position:fixed with viewport coordinates for onboarding card arrow instead of position:absolute
1 parent 76f17ea commit fc51c7b

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

public/css/style.css

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4469,11 +4469,11 @@ tbody tr:hover {
44694469
}
44704470

44714471
.card-arrow {
4472-
position: absolute;
4472+
position: fixed;
44734473
width: 0;
44744474
height: 0;
44754475
pointer-events: none;
4476-
z-index: 2;
4476+
z-index: 10002;
44774477
}
44784478

44794479
.card-arrow::after {
@@ -4485,9 +4485,6 @@ tbody tr:hover {
44854485

44864486
/* Up arrow (card below element) */
44874487
.card-arrow[data-dir="up"] {
4488-
top: -10px;
4489-
left: 50%;
4490-
margin-left: -10px;
44914488
border-left: 10px solid transparent;
44924489
border-right: 10px solid transparent;
44934490
border-bottom: 10px solid var(--border);
@@ -4503,9 +4500,6 @@ tbody tr:hover {
45034500

45044501
/* Down arrow (card above element) */
45054502
.card-arrow[data-dir="down"] {
4506-
bottom: -10px;
4507-
left: 50%;
4508-
margin-left: -10px;
45094503
border-left: 10px solid transparent;
45104504
border-right: 10px solid transparent;
45114505
border-top: 10px solid var(--border);
@@ -4521,9 +4515,6 @@ tbody tr:hover {
45214515

45224516
/* Left arrow (card to the right of element) */
45234517
.card-arrow[data-dir="left"] {
4524-
left: -10px;
4525-
top: 50%;
4526-
margin-top: -10px;
45274518
border-top: 10px solid transparent;
45284519
border-bottom: 10px solid transparent;
45294520
border-right: 10px solid var(--border);

public/js/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4149,6 +4149,17 @@ function positionOnboardingCard(selector) {
41494149
arrow.className = 'card-arrow';
41504150
arrow.dataset.dir = arrowDir;
41514151
card.appendChild(arrow);
4152+
4153+
if (arrowDir === 'left') {
4154+
arrow.style.left = (left - 10) + 'px';
4155+
arrow.style.top = (elRect.top + elRect.height / 2) + 'px';
4156+
} else if (arrowDir === 'up') {
4157+
arrow.style.left = (elRect.left + elRect.width / 2) + 'px';
4158+
arrow.style.top = (top - 10) + 'px';
4159+
} else if (arrowDir === 'down') {
4160+
arrow.style.left = (elRect.left + elRect.width / 2) + 'px';
4161+
arrow.style.top = (top + approxCardH) + 'px';
4162+
}
41524163
}
41534164
}
41544165

0 commit comments

Comments
 (0)