Skip to content

Commit 31a96ac

Browse files
authored
engine: additional fix for the toc (#864)
1 parent 6628120 commit 31a96ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/.vuepress/components/TocWithFeedback.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export default defineComponent({
7575
}
7676
};
7777

78-
7978
/* ----------------------------- */
8079
/* Survey Form State & Logic */
8180
/* ----------------------------- */
@@ -364,7 +363,7 @@ export default defineComponent({
364363
// ——— On mount: Teleport guard + watchers ———
365364
onMounted(() => {
366365
hasMobileTarget.value =
367-
!!document.querySelector<HTMLDivElement>(".markdown-content");
366+
!!document.querySelector<HTMLDivElement>("#markdown-content");
368367

369368
// scroll on hash change
370369
watchImmediate(
@@ -444,7 +443,11 @@ export default defineComponent({
444443
// only teleport on mobile if target exists
445444
const mobileSurvey =
446445
isMobile.value && hasMobileTarget.value
447-
? h(Teleport, { to: ".markdown-content" }, [renderSurveyForm()])
446+
? h(
447+
Teleport,
448+
{ to: "#markdown-content", disabled: !hasMobileTarget.value },
449+
[renderSurveyForm()]
450+
)
448451
: null;
449452

450453
return mobileSurvey ? [tocBlock, mobileSurvey] : tocBlock;

0 commit comments

Comments
 (0)