Skip to content

Commit b66235f

Browse files
authored
fix: guard guided tour highlight against missing target elements (baserow#5378)
* fix: guard guided tour highlight against missing target elements Resolves baserow#5377 * fix: hide highlight overlay when no target elements match Toggle a separate `visible` flag instead of leaving `selector` set when no elements match. Otherwise the .highlight div stays rendered with its 5000px dimming box-shadow over an empty 0×0 box, dimming the whole UI without showing a target. * fix: keep guided tour controls mounted when highlight has no target Falling back to the centred position (the same path empty-selector steps use) instead of unmounting the highlight root keeps the slot — including GuidedTourStep's Next/Finish controls — visible, so users can always advance or finish the tour.
1 parent 0bda673 commit b66235f

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "bug",
3+
"message": "Fixes a guided tour crash when the highlighted element is not on the page",
4+
"issue_origin": "github",
5+
"issue_number": 5377,
6+
"domain": "core",
7+
"bullet_points": [],
8+
"created_at": "2026-05-15"
9+
}

web-frontend/modules/core/components/Highlight.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
v-if="selector !== null"
3+
v-if="visible"
44
class="highlight"
55
:style="{
66
left: `${position.left || '0px'}`,
@@ -45,6 +45,11 @@ export default {
4545
},
4646
}
4747
},
48+
computed: {
49+
visible() {
50+
return this.selector !== null
51+
},
52+
},
4853
mounted() {
4954
const parent = this._getParent()
5055
this.resizeObserver = new ResizeObserver(() => {
@@ -110,15 +115,18 @@ export default {
110115
return
111116
}
112117
113-
if (this.selector.length > 0) {
114-
const elements = this.getElements(this.selector)
118+
const elements =
119+
this.selector.length > 0 ? this.getElements(this.selector) : []
120+
121+
if (elements.length > 0) {
115122
const parentRect = this._getParent().getBoundingClientRect()
116123
const elementRect = getCombinedBoundingClientRect(elements)
117124
position.top = elementRect.top - parentRect.top - this.padding + 'px'
118125
position.left = elementRect.left - parentRect.left - this.padding + 'px'
119126
position.width = elementRect.width + this.padding * 2 + 'px'
120127
position.height = elementRect.height + this.padding * 2 + 'px'
121128
} else {
129+
// Fall back to centered when no targets match
122130
position.top = '50%'
123131
position.left = '50%'
124132
}

0 commit comments

Comments
 (0)