Repository navigation
fix(185122): don't anchor product tour steps to hidden elements - #188
Merged
Merged
Conversation
A stored step selector that only matches a display:none node (a collapsed menu's label, the hidden copy of a responsive menu) was treated as found: the popover pinned to the viewport corner, the overlay blocked the page and a CLICK step had no way forward, so the visitor was stuck until the tour was unpublished (and reloads resumed it). Resolve steps to the first rendered match instead; with none, the existing 5s wait ends in onElementNotFound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LucaB01
approved these changes
Oct 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
Gleap ticket #185122 (Simple School Management). A product tour starts on the customer's site, but the first step ("Click on Library") is stuck. The popover sits in the top-left corner of the viewport, the page is dimmed, and nothing is clickable. Reloading brings the same step back. On 2026-10-14, one visitor was stuck on
/app/library/booksfor 2 h 43 min (16 reloads, notour-…-quitevent). The tour only ended when it was switched back to draft. On 2026-10-20, a second tour ("Cafeteria Tour") hung the same way.Root cause
:nth-child(38) > .cursor-pointer > .py-3 > .flex > :nth-child(2)points at the sidebar item's label<span>.v-show(display:none) whenever the sidebar is collapsed. The group headers that shift thenth-childindex are also only rendered while it is expanded.GleapTours.highlight()took the firstquerySelectormatch without checking that it is rendered. Adisplay:nonenode was therefore treated as found:getBoundingClientRect()is all zeros, so the popover and overlay cut-out are pinned to (0,0)..gleap-tour-active *{pointer-events:none}freezes the rest of the page.allowCloseis off, so there is no way forward.beforeunload+checkForUncompletedTourrestores the step after every reload.onElementNotFound) never ran, because the selector did match.Fix
findRenderedElement()resolves a step's selector to the first rendered match. It usesquerySelectorAllSafeand the existingisElementVisible(offset size or client rects).highlight()and in therefreshActiveHighlight()re-query.onElementNotFound, which quits the tour and frees the page.Not changed: post steps without a selector (dummy element), the tooltip and co-browse engines, and the selector picker.
Verification
Unit tests — new
src/GleapTours.test.js(jsdom;getClientRectsstubbed to honourdisplay:none):npx webpackbuilds. Build artifacts are not committed, matching other fix PRs.li > a.cursor-pointer > div.flex.py-3 > div.flex > [span>i, span(label, display:none)], Library = 38th item). It runs the customer's exact step viaGleap.startProductTourWithConfig(…, true):display:none"Library" span, and the popover is pinned top-left as in the customer's screenshot. Clicks on the Library icon and on a page button do nothing; the tour stays on "1 of 2".destroy()→body.gleap-tour-activeremoved → the page button is clickable again.Note: the customer's site bundles gleap 16.1.1, so they only get this after upgrading. Their tours also need a stable anchor (
data-gleap-touron the menu links) to work in the collapsed sidebar.Ticket: https://app.gleap.ai/projects/613b5dd730aed737108f87ab/bugs/6aca8d83a58db1f5a99292d0
🤖 Generated with Claude Code