Skip to content

Commit e7710a4

Browse files
committed
fix: use fixed spotlight div instead of element box-shadow to avoid sidebar overflow clipping
1 parent c3fb2ec commit e7710a4

2 files changed

Lines changed: 33 additions & 11 deletions

File tree

public/css/style.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4523,11 +4523,15 @@ tbody tr:hover {
45234523
min-width: 100px;
45244524
}
45254525

4526-
.onboarding-highlight {
4527-
position: relative !important;
4528-
z-index: 10000 !important;
4529-
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7) !important;
4526+
.onboarding-spotlight {
4527+
position: fixed;
4528+
z-index: 10000;
4529+
pointer-events: none;
4530+
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
45304531
border-radius: var(--radius-sm);
4532+
background: transparent;
4533+
outline: 2px solid rgba(238, 129, 50, 0.25);
4534+
outline-offset: -1px;
45314535
}
45324536

45334537
.onboarding-dots {

public/js/app.js

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,20 +4047,38 @@ let onboardingStep = 0;
40474047
let onboardingHighlightEl = null;
40484048

40494049
function clearOnboardingHighlight() {
4050-
if (onboardingHighlightEl) {
4051-
onboardingHighlightEl.classList.remove('onboarding-highlight');
4052-
onboardingHighlightEl = null;
4053-
}
4050+
const spotlight = $('#onboarding-spotlight');
4051+
if (spotlight) spotlight.style.display = 'none';
4052+
const el = $('#onboarding-highlight-el');
4053+
if (el) el.removeAttribute('id');
4054+
onboardingHighlightEl = null;
40544055
}
40554056

40564057
function applyOnboardingHighlight(selector) {
40574058
clearOnboardingHighlight();
40584059
if (!selector) return;
4060+
40594061
const el = document.querySelector(selector);
4060-
if (el) {
4061-
el.classList.add('onboarding-highlight');
4062-
onboardingHighlightEl = el;
4062+
if (!el) return;
4063+
4064+
const rect = el.getBoundingClientRect();
4065+
4066+
let spotlight = $('#onboarding-spotlight');
4067+
if (!spotlight) {
4068+
spotlight = document.createElement('div');
4069+
spotlight.id = 'onboarding-spotlight';
4070+
spotlight.className = 'onboarding-spotlight';
4071+
const overlay = $('#onboarding-overlay');
4072+
if (overlay) overlay.appendChild(spotlight);
40634073
}
4074+
4075+
spotlight.style.left = rect.left + 'px';
4076+
spotlight.style.top = rect.top + 'px';
4077+
spotlight.style.width = rect.width + 'px';
4078+
spotlight.style.height = rect.height + 'px';
4079+
spotlight.style.display = 'block';
4080+
4081+
onboardingHighlightEl = spotlight;
40644082
}
40654083

40664084
function positionOnboardingCard(selector) {

0 commit comments

Comments
 (0)