The guided walk finds its elements in the rendered tree

Template refs are filled after a render returns, and later still when the
walk starts inside one of Vue's own post-render updates, where the walk
would have failed with its listeners already in place.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-19 02:16:38 -08:00
1 parent 10a26e15ce
commit 4a6f185d07
3 files changed
+35 -15

No files matched your search

+7 -5
View File
@@ -501,14 +501,16 @@ export function startGuide(steps, { title = '' } = {}) {
...handlers,
});
renderVue(vnode, host);
return vnode.component.exposed;
return vnode;
}
// Focus returns where it was when the walk ends, if that is still there.
const returnFocus = doc.activeElement;
const elements = paint();
const root = elements.root.value;
const ring = elements.ring.value;
const callout = elements.callout.value;
// The elements come from the rendered tree, which is in place as soon as the
// render returns; template refs are filled after it, and later still when
// the walk starts inside one of Vue's own post-render updates.
const root = paint().component.subTree.children[0].el;
const ring = root.querySelector(':scope > .gev-guide-ring');
const callout = root.querySelector(':scope > .gev-guide-callout');
const subRings = [];
const live = steps.filter(Boolean);